Filtering Groups with HAVING
  • Description: Use the HAVING clause to filter grouped data based on aggregate functions. Retrieve departments where the average salary exceeds 50,000.
  • Table Used: employees
    • Columns: employee_id, first_name, last_name, department, salary
  • Expected Columns Returned: department, average_salary
  • Schema:
classDiagram direction BT class Employees { integer employee_id text first_name text last_name text department float salary }

select * from employees