Solutions to SQL problems.
I've only bothered solving the hardest free problems, and I'll add some notes on what I thought of the platform below.
Warning
This repository will contain spoilers for the problems. If you want to solve them yourself, do not look at the solutions.
This project uses Docker to spin up the databases:
Just run Docker's compose command.
docker compose --profile build up --detach
docker compose down --volumes # when you're finishedTo build all services, skip the --profile build flag; to customise which services to build, adjust the docker-compose.yaml file.
You can connect to the databases using any of your favourite SQL clients.
Reviews of the platforms can be found at:
These are just my opinions, and you may have a different experience.
There were some sites that I loved (⭐), some that were okay (👍), and some that I didn't like at all (💩). Similarly, some sites are totally free (🆓) and others have paid features (💰). I didn't try any sites that were completely paid.
The platforms I've reviewed so far are listed below by their relative difficulty (for me).
- SQL Island👍🆓 (review)
- SQL Murder Mystery 👍🆓 (review)
- SQLNoir ⭐🆓 (review)
- Analyst Builder ⭐💰 (review)
- Learn SQL (SQL Practice) ⭐🆓 (review)
- SQL Premier League 👍💰 (review)
- SQL Short Reads 👍🆓 (review)
- StrataScratch 👍💰 (review)
- Lost at SQL 💩🆓 (review)
- Zachary Thomas SQL Questions 💩🆓 (review)
- NamasteSQL 💩💰 (review)
- DataLemur ⭐🆓 (review)
- SQL Squid Game (DataLemur Game) 👍🆓 (review)
- LeetCode 👍💰 (review)
- HackerRank ⭐💰 (review)
- DataExpert.io 👍💰 (review)
- Advent of SQL 👍🆓 (review)
- Claire Carrol's Advanced SQL Challenges ⭐🆓 (review)
- 8 Week SQL Challenge (Data with Danny) ⭐🆓 (review)
- Interview Query ⭐💰 (review)
- Noah's Rug (Hanukkah of Data) ⭐🆓 (review)
- AdvancedSQLPuzzles ⭐🆓 (review)
- Challenging SQL Problems 🆓 (review)
There were some problem sites that I chose to skip completely:
- w3resource: This has an impressive number of free questions (2,605!), but none of them are hard. Good for beginners that want an "endless" list of questions to practice on.
- CodeChef: No free hard questions.
- Code360: Email registration was broken. The "hard" and "ninja" questions all look fairly easy.
- SQL Police Department: This uses a point-and-click interface, you don't actually write the SQL yourself. Might be good for complete beginners. Has some free "cases" to solve.
- SQL Practice: No free hard questions (yet). Feels heavily AI-generated, so concerned about the quality of the data/questions/platform.
For clarity, I'm only reviewing problem sites and the following are (interactive) courses/tutorials, so I've also skipped these: