Multiple choice

Where is the GROUP BY clause statement placed in a SELECT statement that includes a WHERE clause?

  1. Immediately after the SELECT clause

  2. Before the WHERE clause

  3. After the ORDER BY clause

  4. After the WHERE clause

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

In a SELECT statement with both WHERE and GROUP BY clauses, the WHERE clause must come before the GROUP BY clause. The correct order is: SELECT -> FROM -> WHERE -> GROUP BY -> HAVING -> ORDER BY. WHERE filters rows before grouping, while GROUP BY aggregates the filtered rows.