Home Cases Blog About

SQL Lesson Plans

18 ready-made lessons. Each one is a murder case your students solve with SQL.

Print these lesson plans

All 18 lessons at a glance

LessonLevelSQL it teachesTime to solveRight first try
Case 1: Murder on the Orient Express Easy WHERE, ORDER BY, DISTINCT, BETWEEN 17 min 38%
Case 2: The Murder of Roger Ackroyd Easy WHERE, IN, LIKE 20 min 31%
Case 3: The Mysterious Affair at Styles Easy WHERE, ORDER BY, DISTINCT, BETWEEN, IN, COUNT, GROUP BY 21 min 45%
Case 14: The Murder at the Vicarage Easy WHERE, ORDER BY, LIKE 15 min 62%
Case 15: The A.B.C. Murders Easy WHERE, ORDER BY, LIKE, IS NULL 16 min 74%
Case 16: A Murder is Announced Easy WHERE, ORDER BY, LIKE 7 min 78%
Case 4: Murder in Mesopotamia Medium WHERE, ORDER BY, DISTINCT, GROUP BY, CASE, JOIN, LEFT JOIN, IS NULL 27 min 44%
Case 5: Evil Under the Sun Medium WHERE, ORDER BY, LIKE, GROUP BY, CASE 22 min 46%
Case 6: Crooked House Medium WHERE, ORDER BY, LIKE, COUNT, GROUP BY, HAVING, JOIN 41 min 41%
Case 10: Lord Edgware Dies Medium WHERE, ORDER BY, DISTINCT, IN, JOIN 43 min 56%
Case 11: Cards on the Table Medium WHERE, ORDER BY, DISTINCT, LIMIT, IN, COUNT, GROUP BY, JOIN, UNION n/a n/a
Case 12: The Clocks Medium WHERE, ORDER BY, IN, GROUP BY, CASE, JOIN 19 min 38%
Case 7: And Then There Were None Hard WHERE, ORDER BY, DISTINCT, LIMIT, IN, COUNT, GROUP BY, JOIN, LEFT JOIN, IS NULL, ROW_NUMBER 26 min 32%
Case 8: Death on the Nile Hard WHERE, ORDER BY, DISTINCT, LIMIT, IN, LIKE, COUNT, GROUP BY, HAVING, CASE, JOIN, LEFT JOIN, IS NULL, CTE 46 min n/a
Case 9: Five Little Pigs Hard WHERE, ORDER BY, DISTINCT, LIKE, COUNT, SUM, GROUP BY, HAVING, CASE, JOIN, LEFT JOIN, IS NULL, COALESCE, CTE, RECURSIVE, UNION, ROW_NUMBER, LAG, LEAD n/a n/a
Case 13: Appointment with Death Hard WHERE, ORDER BY, LIKE, GROUP BY, JOIN n/a n/a
Case 17: Murder is Easy Hard WHERE, ORDER BY, LIMIT, IN, LIKE, COUNT, GROUP BY, JOIN, ROW_NUMBER n/a 40%
Case 18: Endless Night Hard WHERE, ORDER BY, DISTINCT, LIKE, JOIN, IS NULL 48 min 65%

Time to solve is the median for players who finished all five questions (cases with at least 8 finishes). Right first try is the share of solved questions answered with the first query. Data to November 14, 2026. A pair of students new to SQL will take longer, so allow about double.

Three ready-made plans

One lesson (50 to 60 minutes): the taster

  1. 10 min. Put Case 1 on the projector. Read the story and run question 1 together
  2. 30 min. Pairs finish Case 1. One types, one checks the table list. Swap every question
  3. 10 min. Compare two different queries that both passed. Ask why both are right
  4. Extension. Fast pairs start Case 14

Three lessons: from filtering to JOINs

LessonCasesFocusTalk about
11 and 14SELECT, WHERE, ORDER BYWhy text needs single quotes
22 and 3LIKE, IN, BETWEEN, COUNT with GROUP BYA query that runs and returns nothing
34JOIN, LEFT JOIN and IS NULLFinding the suspect with no record

Six weeks: a full SQL unit

WeekCasesFocus
11, 14, 16SELECT, WHERE, ORDER BY
22, 15LIKE, IN, BETWEEN, NULL
33, 5COUNT, GROUP BY, CASE
44, 10JOIN and LEFT JOIN
56, 12JOIN with GROUP BY and HAVING
67 or 8Subqueries, CTEs and a first window function

Where students get stuck

From the queries players have sent us:

Student worksheet

Ask each pair to fill this in for every question. It turns guessing into thinking and gives you something to mark.

QuestionWhat are we looking for?Tables and columns we needThe query that workedWhat the result told us
1 
2 
3 
4 
5 

Before the lesson

Every lesson in detail

Case 1: Murder on the Orient Express

Easy · median 17 minutes and 15 queries · WHERE, ORDER BY, DISTINCT, BETWEEN

  1. Identify the Passengers
  2. When and where was everyone?
  3. Who Was in Compartment 4?
  4. Who Had a Motive?
  5. Who Stabbed Samuel Ratchett?
Open Case 1

Case 2: The Murder of Roger Ackroyd

Easy · median 20 minutes and 16 queries · WHERE, IN, LIKE

  1. Identify the Key Parties Involved
  2. Who was in the Drawing Room or the Garden?
  3. Which "Sheppard" family members were in the Study?
  4. Who last saw Roger Ackroyd alive?
  5. Who murdered Roger Ackroyd?
Open Case 2

Case 3: The Mysterious Affair at Styles

Easy · median 21 minutes and 15 queries · WHERE, ORDER BY, DISTINCT, BETWEEN, IN, COUNT, GROUP BY

  1. Identify the Key Parties Involved
  2. How many suspects claimed each alibi location between 4:45 and 5:15 AM
  3. Who was in the bedroom between 4:45 to 5:15 AM?
  4. Who was not in the bedroom when Emily died?
  5. Who murdered Emily Inglethorp?
Open Case 3

Case 14: The Murder at the Vicarage

Easy · median 15 minutes and 10 queries · WHERE, ORDER BY, LIKE

  1. Meet the suspects
  2. Who was at the vicarage?
  3. Who is the artist?
  4. Who confessed to the murder?
  5. Who killed Colonel Protheroe?
Open Case 14

Case 15: The A.B.C. Murders

Easy · median 16 minutes and 8 queries · WHERE, ORDER BY, LIKE, IS NULL

  1. Meet the suspects
  2. Where did each murder happen?
  3. Who was wrongly accused?
  4. Who stood to gain from the third victim's death?
  5. Who committed the A.B.C. murders?
Open Case 15

Case 16: A Murder is Announced

Easy · median 7 minutes and 6 queries · WHERE, ORDER BY, LIKE

  1. Meet the suspects
  2. Who was at Little Paddocks that night?
  3. Who was paid to stage the fake hold-up?
  4. Who stood to inherit if Miss Blacklock died?
  5. Who committed the murder?
Open Case 16

Case 4: Murder in Mesopotamia

Medium · median 27 minutes and 22 queries · WHERE, ORDER BY, DISTINCT, GROUP BY, CASE, JOIN, LEFT JOIN, IS NULL

  1. Identify the Key Parties Involved
  2. What is the timeline of alibis from earliest to latest?
  3. What are each suspect's alibi details?
  4. Who never saw the victim alive?
  5. Who murdered Louise Leidner?
Open Case 4

Case 5: Evil Under the Sun

Medium · median 22 minutes and 15 queries · WHERE, ORDER BY, LIKE, GROUP BY, CASE

  1. Identify the Key Parties Involved
  2. Group Suspects by Their Alibi Timings
  3. Who never claimed to be at Pixy Cove?
  4. Who shared alibi locations?
  5. Who strangled Arlena Marshall?
Open Case 5

Case 6: Crooked House

Medium · median 41 minutes and 17 queries · WHERE, ORDER BY, LIKE, COUNT, GROUP BY, HAVING, JOIN

  1. Identify the Key Parties Involved
  2. Which family roles repeat?
  3. What were the first names of every Leonides family member?
  4. Which Leonides family members have an explicit motive?
  5. Who killed Aristide Leonides?
Open Case 6

Case 10: Lord Edgware Dies

Medium · median 43 minutes and 19 queries · WHERE, ORDER BY, DISTINCT, IN, JOIN

  1. Meet the Suspects
  2. Who Had Alibis at Key Locations?
  3. Which Suspects Have Recorded Events?
  4. Who Was First at Each Location?
  5. Who Killed Lord Edgware?
Open Case 10

Case 11: Cards on the Table

Medium · WHERE, ORDER BY, DISTINCT, LIMIT, IN, COUNT, GROUP BY, JOIN, UNION

  1. How Many Suspects vs Investigators?
  2. How Many Times Was Each Suspect the Dummy?
  3. Which Guests Were Suspected of Past Murders?
  4. Which Round Had the Highest Bid, and Who Was the Dummy?
  5. Who Killed Mr. Shaitana?
Open Case 11

Case 12: The Clocks

Medium · median 19 minutes and 11 queries · WHERE, ORDER BY, IN, GROUP BY, CASE, JOIN

  1. Meet the people involved
  2. Who appears in the timeline of events?
  3. What motives or connections were recorded?
  4. Who was linked to the inheritance?
  5. The full reveal, murder and espionage
Open Case 12

Case 7: And Then There Were None

Hard · median 26 minutes and 19 queries · WHERE, ORDER BY, DISTINCT, LIMIT, IN, COUNT, GROUP BY, JOIN, LEFT JOIN, IS NULL, ROW_NUMBER

  1. List All Accusations
  2. Determine the Sequence of Deaths
  3. Cross-Reference Accusations with Death Events
  4. Find Guests Without Orchestration Events
  5. Who Orchestrated the Killings?
Open Case 7

Case 8: Death on the Nile

Hard · median 46 minutes and 25 queries · WHERE, ORDER BY, DISTINCT, LIMIT, IN, LIKE, COUNT, GROUP BY, HAVING, CASE, JOIN, LEFT JOIN, IS NULL, CTE

  1. Identify Passengers
  2. Who Was Where?
  3. Cross-Reference Alibis
  4. Find the Jewel Thief
  5. Who Had Multiple Event Types?
Open Case 8

Case 9: Five Little Pigs

Hard · WHERE, ORDER BY, DISTINCT, LIKE, COUNT, SUM, GROUP BY, HAVING, CASE, JOIN, LEFT JOIN, IS NULL, COALESCE, CTE, RECURSIVE, UNION, ROW_NUMBER, LAG, LEAD

  1. Build the Testimony Chain
  2. Analyze Testimony Consistency
  3. Timeline Gaps - Who Has Unaccounted Time?
  4. Find Who Was Mentioned Most
  5. Identify the Killer
Open Case 9

Case 13: Appointment with Death

Hard · WHERE, ORDER BY, LIKE, GROUP BY, JOIN

  1. Meet the suspects and their relation to the victim
  2. First and last appearance in the timeline
  3. Who had a recorded motive?
  4. Whose motive was tied to the victim's past?
  5. Who killed Mrs. Boynton?
Open Case 13

Case 17: Murder is Easy

Hard · WHERE, ORDER BY, LIMIT, IN, LIKE, COUNT, GROUP BY, JOIN, ROW_NUMBER

  1. Meet the villagers
  2. Sequence of "accidents"
  3. Who appears in the most events?
  4. Whose motive points to revenge or framing?
  5. Who committed the murders?
Open Case 17

Case 18: Endless Night

Hard · median 48 minutes and 11 queries · WHERE, ORDER BY, DISTINCT, LIKE, JOIN, IS NULL

  1. Meet the cast
  2. Key events at Gipsy's Acre
  3. Who are the victims?
  4. Whose motive mentions wealth, marriage, or the land?
  5. Who killed Ellie?
Open Case 18

Tell us how it went

Using these in a class? We'd love to hear what worked and what didn't: querythemurder@gmail.com. If you list classroom resources on a school or course page, you're welcome to link to this one.

Try Case 1 yourself →