juniorSQL

What is a WHERE clause?

Updated May 17, 2026

Short answer

WHERE filters rows based on conditions.

Deep explanation

The WHERE clause restricts query results by evaluating conditions on each row before grouping or aggregation.

Real-world example

Filtering active customers only.

Common mistakes

  • Using WHERE instead of HAVING for aggregates.

Follow-up questions

  • Can WHERE use multiple conditions?
  • Does WHERE run before GROUP BY?

More SQL interview questions

View all →