Learning SQL can get real boring, real quickly! While I made our free SQL tutorial casual AF, I'm still constantly asked by Data Analysts & Data Scientists "how do I make l learning SQL FUN??".
So, I found and played these 4 amazing games to learn SQL:
Let's dive into each SQL game to find out what makes them so cool (along with a bonus 5th interactive SQL resource) ๐๐
The Knight Lab at Northwestern University put together a fun SQL murder mystery. You use your SQL skills to hunt down the killer that's loose in SQL city! It's 100% free, and you run the SQL queries online so no need to install anything!
The game starts by exploring a few of the tables, and slowly, you discover clues around the murder. For example, early-on you find a police report that mentions two witnesses but doesn't identify the suspect. You then with a witness interviews table, and slowly get closer to identifying the killer.
If you get stuck while solving the murder, have no fear, we create a step-by-step solution for SQL Murder Mystery.
In this adventure game, you're stranded on SQL island after a tragic plane crash, and have to use your SQL skills to find a way to escape the island.
For example, one of the tasks in SQL Island is to collect gold by working as a baker with one of the local island inhabitants. To find a job in the game, you'd write this SQL WHERE query:
For a full guide on solving SQL Island, I wrote up all the SQL Island Answers in English.
SQL Island defaults to German, which can be a confusing for English speakers! However, to play SQL Island in english, you can manually change the game language from the settings, or use our special link to play SQL Island in English: http://wwwlgis.informatik.uni-kl.de/extra/game/?lang=en.
For more help, check out this SQL Island Walk-Through.
In SQLPD, you solve crimes while learning SQL in the process! While this is a paid resource, you can try a few of the police cases for free! I like this resource because it's witty and well-written.
It's definitely not the best place to learn advanced SQL. However, having to think critically to dissect a question in plain English and then translate it into a query is a very important skill to practice for any aspiring Data Analyst, so it still makes our list of fun SQL games!
Schemaverse is a space-based strategy game implemented entirely within a PostgreSQL database.
You can compete against other players using raw SQL commands to command your fleet! For example, to collect money (which can be redeemed for ship upgrades and more powerful ships) you can mine planets with this command:
If your SQL skills are weak, you can even build an AI in Python and have your fleet command itself! The only downside of this resource is it's a bit dead โ it feels like Schemaverse was much more active in the early 2010's.
DataLemur is an interactive SQL interview practice platform that offers a simple & fun way to practice real SQL interview puzzles you'll encounter as a Data Analyst or Data Scientist. You don't need to install anything โ just run the SQL queries online!
For example, try this real Amazon SQL interview question which is featured in the bigger article, 6 real Amazon SQL interview questions:
Note that each SQL interview question comes with detailed solutions, along with multiple hints if you get stuck because some of the questions can be very tricky! You'll also find a comprehensive 6,000-word SQL interview guide on DataLemur, which covers everything you need to know to prep and practice for hard SQL interview questions.
Finally, if these SQL questions are too tricky for you, there's a 100% free SQL tutorial too, with 30+ SQL lessons ranging from beginner SQL to advanced SQL for data analysis.
If you're trying to learn SQL to break into Data Analytics, starting with SQL is great BUT the field is so much bigger, requiring Statistics and Business skills as well. For resources I recommend, checkout this list of best books for Data Analysts.
If you're loving these games go check out these 6 Data Science games! These games will help you cover topics from Statistics, Machine Learning, A/B Testing, Product Sense, and SO much more.