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 a SELECT statement with multiple clauses, the order is: SELECT > FROM > WHERE > GROUP BY > HAVING > ORDER BY. The GROUP BY clause must come after the WHERE clause because rows must first be filtered by WHERE before being grouped by GROUP BY.