juniorDatabases

Explain the difference between WHERE and HAVING clauses.

Updated Apr 28, 2026

Short answer

WHERE filters rows before grouping; HAVING filters groups after the GROUP BY clause.

Deep explanation

Deep dive into foundational storage. Understanding how data is stored on disk vs memory. Discussion on the relational model proposed by E.F. Codd.

Real-world example

A library system where books (primary key) are linked to authors (foreign key).

Common mistakes

  • Confusing NULL with an empty string.

Follow-up questions

  • What is 3NF?

More Databases interview questions

View all →