SQL practice: The Order Things Actually Happen

Chapter 32 · 6 questions · included in full access

  1. Question 1 · easy

    Why does WHERE COUNT(*) > 5 always error?

    Solve it in your browser
  2. Question 2 · easy

    Why does an AS alias work in ORDER BY but not in WHERE?

    Solve it in your browser
  3. Question 3 · medium

    Why can't you filter on ROW_NUMBER() in the same query that creates it?

    Solve it in your browser
  4. Question 4 · medium

    Between WHERE branch_id = 1 and HAVING branch_id = 1 on a grouped query, which is faster and why?

    Solve it in your browser
  5. Question 5 · hard

    A query has a JOIN and a WHERE. Which happens first, and why does that matter for a LEFT JOIN?

    Solve it in your browser
  6. Question 6 · hard

    Why can HAVING use COUNT(*) when WHERE cannot?

    Solve it in your browser

These questions are part of full access.

The first chapters of every track are free. Full access is a one-time payment.

See pricing