Learn and Practice SQL With This Game

Have you ever tried learning SQL, a query language that allows you to dig into the internals of databases? Most tutorials start by creating your own database, filling it up with bullshit, and then running queries that will make your eyes dim (hooray, we can model the accounting for a widget factory). However, Knight Lab’s SQL Murder Myster y makes things a little more fun.

In the game, you know that a murder was committed, but you lost the police report with its description. Knowing only the date and place, can you analyze the information in the police database to find out who the killer was?

The script is a bit contrived, but it works like a puzzle because you have a question that forces you to dive into the data. My SQL was a little rusty, so I immediately googled a little syntax I forgot and started looking. At the end of the day, this is how we solve real-life coding problems: figure out what tools you need to answer the question you really care about.

In the game, you start by orienting yourself – what tables are there in this database? For example, it is easy to find an entry in a police report, but it does not mention a suspect; instead, he simply refers to two witnesses. In another table, you can find interviews with witnesses and then look for clues (for example, one witness memorizes part of a criminal’s license plate).

I used to work with SQL databases and at first it was annoying how they were set up. ( I would do otherwise.) On the other hand, in real life, you often have to retrieve information from a database that is oddly organized. There is also no detailed explanation as to why the police database also contains useful but scattered information, such as checks on participants at the local gym. But while it might not make sense to meet all of these things in one database in the real world, it gives you an idea of ​​how some of the information (license plate, gym surveillance) can give you access to a ton of additional information. if you can just find the correct data source.

This game will probably take you 10-15 minutes if you are already proficient in SQL, or you can use it to guide a longer session if you are still learning. (There is an accompanying walkthrough that teaches you on the go.) The bonus level at the end forces you to figure out who hired the hitman and do it with three tables (at least that’s how I did it). Because if you really want to learn how to use the tool, you need to figure out how to ask and answer your questions, not just read a tutorial.

More…

Leave a Reply