SQL Detective Mystery is a detective case you solve by asking questions of a database. A murder happened in SQL City on January 15, 2018, and the only lead is that you once read the crime scene report. Every clue after that, from witness interviews to gym check-ins, sits in tables you can only reach with SQL. The queries run right in the page, so there is nothing to install.
How to Play SQL Detective Mystery
The page gives you several code boxes. Each one holds a starting query that you can edit and run, and the results appear as a table underneath. The first two boxes show how to list the tables and how to see the columns of one table.
From there you work like a detective. Find the report for the murder, read who the witnesses were, then look those people up in the person and interview tables. Their statements point at a gym membership, a car and other details you can match in further tables.
When you think you know the name, type it into the “Check your solution” box and run it. A wrong name gets a polite “try again”. The right one opens a second, harder step that asks who was really behind the crime.
SQL Detective Mystery Controls
| Action | Keyboard | Mouse | Touch |
|---|---|---|---|
| Type or edit a query | Type in the code box | Click inside a code box | Tap a code box to bring up the keyboard |
| Run the query in a box | Shift + Enter | Click Run | Tap Run |
| Put the box back to its starting query | — | Click Reset | Tap Reset |
| Show the database diagram | — | Click the "click here" link above the last code box | Tap the "click here" link |
| Reveal a suggested query (walkthrough page) | — | Click Show Solution | Tap Show Solution |
Tips for Cracking the Case
- Read the schema first. The diagram shows how person, drivers_license, interview and the gym tables link by ID, which saves many blind guesses.
- Filter early. A WHERE clause on date, city and crime type turns more than a thousand reports into the one you need.
- Use LIKE for partial names. A witness may be known only by a first name, so
name LIKE '%Annabel%'works better than an exact match. - Sort to find extremes. ORDER BY with DESC and LIMIT 1 is the quick way to find “the last house on a street”.
- Join instead of copying IDs. Linking tables with JOIN lets one query check a license plate, a gym badge and a check-in date at once.
- Write clues down. Names, IDs and dates scroll away quickly, and the page does not keep them.
Features
- A real SQLite database with about 10,000 people, 1,228 crime scene reports and thousands of interviews, licenses and check-ins.
- Beginner walkthrough on a second page with runnable examples and optional suggested queries.
- Built-in answer checker that confirms the killer and then unlocks a bonus question.
- Works fully offline once loaded, since the SQL engine runs inside your browser.
Tested and updated:













