Teach SQL with a murder to solve
18 free cases based on Agatha Christie novels. Students write real SQL queries to find the killer.
Why it works in a classroom
- Free. Every case and every question. There is no paid tier.
- No accounts. Students open the site and start. No sign-ups and no passwords to reset.
- Nothing to install. Queries run on our server, so any up-to-date browser on a laptop or desktop works, school Chromebooks included. The game doesn't run on phones.
- The schema stays on screen. Every question lists its tables and columns, and the query box suggests names as students type. Time goes into thinking about the query, not hunting for column names.
- A reason to care. Each query answers a question in an investigation. A wrong join points at the wrong suspect.
What students practise
Each case has five questions that build towards naming the killer. Based on the official solutions:
- Easy cases (1, 2, 3, 14, 15, 16): one table at a time.
SELECT,WHERE,ORDER BY,BETWEEN,INand filtering on times. - Medium cases (4, 5, 6, 10, 11, 12):
JOINs across tables,GROUP BYwithCOUNTandSUM,CASE,LIKEand a first look at subqueries. - Hard cases (7, 8, 9, 13, 17, 18): multi-table and
LEFT JOINs,GROUP BYwithHAVING, subqueries, window functions and a CTE.
A suggested 60 to 90 minute session
- Intro (10 minutes). Put Case 1 on the projector. Read the story, point out the schema and run the first query together.
- Cases 1 and 2 in pairs (40 to 60 minutes). One student types while the other reads the schema and checks the logic. Swap at every question.
- Discussion (15 minutes). Compare queries that reached the same answer in different ways. Ask which clue gave the killer away.
Good to know before class
- Question 5 names the killer. Pairs who finish early can spoil it for the room, so ask them to keep it quiet.
- Every question has a Reveal answer button that shows the solution query. It rescues a stuck pair, so decide up front whether it's allowed.
- Progress lasts until the browser is closed. A student who closes it mid-case starts that case again from question 1. On shared computers, close the browser at the end of class so the next student starts fresh.
Using this in a class? Tell us how it went: querythemurder@gmail.com