1. What is the primary difference between the WHERE and HAVING clauses?
- WHERE filters rows before grouping; HAVING filters collapsed groups after aggregation.
- WHERE filters groups; HAVING filters columns.
- HAVING is faster than WHERE.
- There is no functional difference.
Hint: WHERE applies to individual rows before the aggregation step. HAVING applies to the aggregated group rows after GROUP BY completes.