Multiple choice technology databases

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 SQL, the clause order is: SELECT → FROM → WHERE → GROUP BY → HAVING → ORDER BY. The GROUP BY clause must come after the WHERE clause when both are present. Option D correctly places GROUP BY after WHERE.