Select the correct order of clauses
-
GROUP BY, HAVING, WHERE
-
HAVING, WHERE, GROUP BY
-
GROUP BY, WHERE, HAVING
-
WHERE, GROUP BY, HAVING
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.