Database Management
primer-original-v2mediumSQLWHEREHAVINGGROUP BYprimer-original-v2

What is the difference between WHERE and HAVING clauses in SQL?

Answer options

A
WHERE filters groups, HAVING filters rows
B
WHERE filters rows before grouping, HAVING filters groups after aggregation
C
They are interchangeable
D
WHERE works only with JOIN, HAVING works only with GROUP BY

Correct answer: WHERE filters rows before grouping, HAVING filters groups after aggregation

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Database Management, understanding the underlying mechanics of SQL is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Database Management questions

Practice more Database Management questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.