Group By with HAVING on MIN/MAX

Medium
group-by DoorDash Netflix Spotify

Write a query to find departments where the salary difference between the highest and lowest paid employee is greater than 20000. Return department, min_salary, max_salary, and salary_range, ordered by salary_range DESC.

Expected Output: Departments with large salary ranges.

Tables

Hints (3 available)

SQL Editor

Output

Click "Run" to see results...