Question 1Easy
Which clause filters groups after aggregation?
- HAVING
- ORDER BY
- LIMIT
- WHERE
Answer: A. HAVING
Explanation
WHERE filters rows before grouping; HAVING filters the aggregated groups.
Step-by-step solution
- WHERE filters rows before grouping.
- HAVING filters groups after aggregation.
Why the other options are wrong
- B. ORDER BY sorts; it does not filter.
- C. LIMIT caps the number of rows returned.
- D. WHERE runs before grouping and cannot use aggregates.
Tip: WHERE = rows; HAVING = groups.