SQL Detective Mystery Unblocked
The only witness is a database. Ask it the right questions and the killer has nowhere to hide.
What is SQL Detective Mystery?
SQL Detective Mystery is a single-player detective puzzle played by writing SQL queries. A murder took place in SQL City, and every clue lives in database tables such as crime reports, interviews and driver's licenses. You win by identifying the murderer, and a bonus round asks who was pulling the strings.
- Category
- Puzzle Games
- Players
- 1 player
- Plays on
- Best on desktop, playable on touch
- Input
- Keyboard, Mouse, Touch
- Checked
SQL Detective Mystery is a murder case where your only investigative tool is a query language. A body turned up in SQL City in mid-January 2018, and your only memory is that a police report about it was filed. Witness names, statements, car registrations and gym check-ins are all stored in tables, and you reach them by typing real SQL into boxes on the page. It was created by Northwestern’s Knight Lab, and here it runs unblocked with a full SQLite engine inside your browser, so nothing needs installing.
Working the Case
The page is a series of code boxes. Every box comes preloaded with an example you are free to change, and running it prints a results table underneath. The first boxes show you how to list every table and how to inspect the columns in one of them. That is your map.
From there it is classic detective work. Pull up the correct report using its date, crime type and city. Note the witnesses it mentions. Look them up in the person table, then read their interview transcripts. Their statements mention details like a gym membership level, part of a license plate and a check-in date, and each detail is a filter you can apply to another table.
Once you have a suspect, put the name into the answer checker at the bottom. A miss gets a gentle nudge. A hit opens the second act.
SQL Detective Mystery controls
| To do this | Keyboard | Mouse | Touch |
|---|---|---|---|
| Write or change a query | Type in a code box | Click into a code box | Tap a code box to open the keyboard |
| Run the query | Shift + Enter | Click Run | Tap Run |
| Restore the box's original query | — | Click Reset | Tap Reset |
| Open the schema diagram | — | Click the "click here" link above the last box | Tap the "click here" link |
| See a suggested query on the walkthrough | — | Click Show Solution | Tap Show Solution |
SQL Habits That Crack Cases Faster
- Study the schema diagram before you query. It maps which ID columns tie the people, licence, interview and gym tables to one another. Knowing the links saves dozens of blind guesses.
- Narrow results with WHERE. There are over a thousand crime reports, so combine the date, crime type and city in one filter.
- Match partial text with LIKE. Sometimes all you know is part of a name or a street. A pattern with % wildcards finds them.
- Sort for “the last” or “the first.” Sorting in descending order and keeping a single row answers questions like which house is at the end of a street.
- Join tables instead of copying IDs by hand. A single JOIN can test a number plate, a membership and a visit date together.
- Keep notes outside the page. Results scroll away and nothing is saved, so jot down every name and ID.
Who Should Play It
This is a perfect fit for students in a computing class, analysts who want to practise joins, or anyone who likes a whodunnit with a bit of homework. The dataset is large and realistic, with roughly ten thousand people, so you cannot solve it by scrolling.
If you like learning a technical skill through a puzzle, CSS Diner teaches selectors in a similar spirit, and Learn Git Branching does the same for version control.
SQL Detective Mystery: questions players ask
Can a total beginner solve SQL Detective Mystery?
Yes. A linked tutorial page covers selecting columns, filtering rows, pattern matching, counting and joining tables, all with runnable examples. You can work through the whole case from there, using its suggested queries when you get stuck.
How do I submit my answer?
Scroll to the answer box at the bottom, type your suspect's complete name over the placeholder and run it. The database replies with whether you caught the killer.
What is the bonus challenge?
After the correct killer, a message reveals that someone else was behind the crime and challenges you to find that person using no more than two queries.
Does SQL Detective Mystery work on a phone?
Partly. The queries run fine, but typing SQL and reading wide result tables is much easier with a real keyboard and a bigger screen. A laptop or Chromebook gives the best experience.
Will the page remember my progress?
No. The database runs inside the open page only, so a reload returns every box to its starting query. Keep a list of every person and ID you uncover.
Credits and license
SQL Detective Mystery was created by NUKnightLab (Joon Park, Cathy He, Joe Germuska) and released as open source. FreezeNova hosts a lightly adapted copy on its own server, together with the original license file.
- Source code: github.com/NUKnightLab (original project)
- Code license: MIT
- Art & audio: CC BY-SA 4.0 (case text and database content); sql.js and CodeMirror, MIT
- Our changes: We renamed it, removed analytics, the original site's menus, fonts and detective artwork, host the editor styles ourselves and added a simple stylesheet. The case, the database and the answer checker are unchanged.