Question

Given the following SQL query: SELECT department _ id, COUNT(*) AS employee _ count FROM employees GROUP BY department_id HAVING COUNT(*) > 5; What is the purpose of the HAVING clause in this query?

A To filter rows before grouping them.
B To filter rows after grouping them.
C To apply a condition to the entire table.
D To apply conditions only to the COUNT(*) function.
E To sort the rows by department _ id.
Practice Next

Hey! Ask a query