Command Categories

Comments

Single line: --

Multiple lines: /* */

Common Clauses & Order

Writing Order

  1. SELECT
  2. FROM
  3. JOIN ON
  4. WHERE
  5. GROUP BY
  6. HAVING
  7. ORDER BY
  8. LIMIT / OFFSET

Logical Execution Order (with group aggregation)

  1. FROM / JOIN ON: Source tables and join conditions