Community SQL exercises

Puzzles written by other learners on the SQLearn pizzeria database. Solve them for XP, or write your own and submit it for review.

Writing a good puzzle

  • Ask a question a real analyst might ask: revenue by something, customers who did or did not do something, a top-N list.
  • Name the columns you expect, since the grader compares column names as well as values.
  • Say whether row order matters. If it does, the solver needs an ORDER BY.
  • Give a hint that nudges without giving the answer away.

Submissions are reviewed before they appear, usually within a day or two.