SQL Detective Mystery
SQL Detective Mystery is a crime case you can only crack by querying a database. A murder took place in SQL City, and the date on record is January 15, 2018. Every other fact is hidden in tables of reports, interviews and records.
The database runs inside the page itself, so nothing gets installed and it works in a regular browser on a school laptop. It suits anyone who knows a little SQL or wants a reason to learn.
How to play SQL Detective Mystery
The page is made of code boxes. Each holds a starting query you can edit, and pressing Run shows the results as a table right below. The opening boxes demonstrate two basics: seeing which tables exist and seeing what columns a table holds.
Begin with the crime scene report for that date and city. It names witnesses, and you can look them up in other tables to read what they said. Their statements lead to more records you can match up, piece by piece.
When you have a suspect, enter the name in the solution check box and run it. A wrong guess gets a gentle no. A correct name unlocks a second, tougher question about who was really behind it. A separate walkthrough page teaches the basics for beginners.
Controls
| Action | Keyboard | Mouse | Touch |
|---|---|---|---|
| Write or edit a query | Type in a code box | Click a code box | Tap a code box |
| Run the query | Shift + Enter | Run button | Run button |
| Restore the starting query | — | Reset button | Reset button |
| View the database diagram | — | Click the diagram link | Tap the diagram link |
Tips
- Open the schema diagram before anything else. It shows which ID columns connect one table to another.
- Narrow results with WHERE on date, type and city right away, or you will scroll through a long list of reports.
- Witnesses may be described only partly. LIKE with % wildcards finds a name or street when you only know a piece of it.
- To find the biggest or last value in a column, sort it in descending order and keep only the top row.
- Keep notes in a separate tab or on paper. Names, IDs and dates scroll away fast and the page does not save them.
If you like SQL Detective Mystery, try these
CSS DinerTyping real code to select the right things links these, using CSS selectors on plates of food.
Learn Git BranchingReal commands typed into a puzzle drive this too, with git reshaping an animated commit tree.
Questions
Do I need to know SQL to play SQL Detective Mystery?
Basic SELECT, WHERE and JOIN knowledge helps a lot. If you are brand new, start with the walkthrough page, which explains each step with examples you can run.
Does SQL Detective Mystery work on a phone?
It loads and runs, but typing queries on a small touch keyboard is slow. A laptop or Chromebook with a real keyboard is much more comfortable.
Is my progress saved?
No. The page does not remember your queries or notes, so a reload resets the boxes. Copy anything important before you leave.
More like this: all puzzle games · every game A–Z