Written Order and Processing Order Differ
SQL is written with SELECT first, but processing starts with FROM. An aggregate query proceeds through FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, and LIMIT.
GOAL
Explain the logical order of the major clauses.
Which clause is processed immediately before GROUP BY?