with cte as( select e.department_id,s.amount,date_format(pay_date,'%Y-%m') as monthe from employee e join salary s on e.employee_id=s.employee_id), cte2 as( select *,round(avg(amount) over (partition by monthe)) as avg_salary from cte) select department_id,monthe, (case when sum(amount)=avg_salary then 'Same' when sum(amount)>avg_salary then 'higher' else 'Lower' end) as comparison from cte2 group by department_id,monthe; I have tried this on my own, hope it helps :)
@karthikr4185 Жыл бұрын
Great thanks for sharing nice and easy solution
@playwithvihaan7601 Жыл бұрын
Good job.
@karangohil45582 жыл бұрын
can you solve some of the stratascratch question too, it might be helpful..
@EverydayDataScience2 жыл бұрын
Sure Karan, let me finish all 200 of Leetcode and we can move on to Stratascratch next.
@rayyanamir85602 жыл бұрын
More medium problems please.... :)
@EverydayDataScience2 жыл бұрын
Sure Rayyan, more videos of easy medium and hard will be coming regularly.