37. Filter Groups With HAVING
MediumDatabases~12 min
Return each department_id and its average salary, but only for departments whose average salary is above 55000.
Skip the employee with no department.
Examples
Example 1
- Input:
- employees
- Output:
- 1 | 78333.33…
Constraints
Return exactly two columns: department_id, then the average salary.Exclude rows where department_id is NULL.Row order does not matter.