WHERE vs HAVING
Multiple Choice Medium
Question
What is the key difference between WHERE and HAVING?
Hint
One runs before GROUP BY, the other after.
Explanation
WHERE filters individual rows before they are grouped (cannot use aggregate functions). HAVING filters groups after GROUP BY (can use aggregate functions like COUNT, SUM).
Related Resources
Related Lessons
- GROUP BY
Learn WHERE and HAVING.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.