LeetCode Hard 615 "Average Salary: Departments VS Company" Amazon Interview SQL Question Explanation

  Рет қаралды 1,742

Everyday Data Science

Everyday Data Science

Күн бұрын

Пікірлер: 8
@Karthikmahi007
@Karthikmahi007 Ай бұрын
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
@karthikr4185 Жыл бұрын
Great thanks for sharing nice and easy solution
@playwithvihaan7601
@playwithvihaan7601 Жыл бұрын
Good job.
@karangohil4558
@karangohil4558 2 жыл бұрын
can you solve some of the stratascratch question too, it might be helpful..
@EverydayDataScience
@EverydayDataScience 2 жыл бұрын
Sure Karan, let me finish all 200 of Leetcode and we can move on to Stratascratch next.
@rayyanamir8560
@rayyanamir8560 2 жыл бұрын
More medium problems please.... :)
@EverydayDataScience
@EverydayDataScience 2 жыл бұрын
Sure Rayyan, more videos of easy medium and hard will be coming regularly.
@minren3260
@minren3260 9 ай бұрын
Why use left join
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 34 МЛН
Não sabe esconder Comida
00:20
DUDU e CAROL
Рет қаралды 50 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
LeetCode 1412: Find the Quiet Students in All Exams [SQL]
13:27
Frederik Müller
Рет қаралды 2,4 М.
Which Database Model to Choose?
24:38
High-Performance Programming
Рет қаралды 58 М.
Go Has Exceptions??
16:58
ThePrimeTime
Рет қаралды 70 М.
LeetCode 1097: Game Play Analysis V (Hard) [SQL]
12:33
Frederik Müller
Рет қаралды 3 М.
What's in the clown's bag? #clown #angel #bunnypolice
00:19
超人夫妇
Рет қаралды 34 МЛН