Multiple choice technology databases

Select the correct order of clauses

  1. GROUP BY, HAVING, WHERE

  2. HAVING, WHERE, GROUP BY

  3. GROUP BY, WHERE, HAVING

  4. WHERE, GROUP BY, HAVING

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The WHERE clause filters individual rows before grouping, then GROUP BY aggregates those rows into groups, and finally HAVING filters the aggregated groups based on group-level conditions. This order ensures efficient query execution.