The short version
- Start with the SQL Murder Mystery. It is the free browser game you half remember, and one evening brings your joins back.
- Games teach querying, your own server teaches the job. No practice site lets you create a user or take a backup.
- Use a sandbox to check a version. dbfiddle.uk runs MySQL 5.5 through 9.7 side by side.
- Four weeks, three sessions a week. Two weeks in the browser, then two on the MySQL server you installed.
- Give the AI six things. Engine and version, schema, sample rows, expected output, constraints, and a request to explain itself.
- Verify every answer. Run it on dev, wrap writes in a transaction, and read the WHERE clause before an UPDATE or DELETE.
Practice sites, in the order to try them
The list is ordered by what to try first, so work down it: story games, then drill sets, then the MySQL ones. Most games run SQLite inside your browser, which is fine, because joins, grouping and NULL behave there as they do in MySQL. Dates, error messages and the system catalog do not, and you will practice those on your own server in week 3. A badge means the site runs your query on a real engine: MySQL PostgreSQL.
- SQL Murder Mystery
The one you remembered: solve a murder in SQL City with filters and joins. SQLite in the browser, free, no account.
- SQL Noir
The same skills with better writing, across several detective cases. SQLite, three cases free, the rest a one-time license.
- SQL Island
A text adventure that also makes you INSERT, UPDATE and DELETE. SQLite, free, and you switch it to English inside the game.
- Lost at SQL
Escape a sinking ship over 20 chapters when one case felt too short. SQLite, free.
- Station Zero PostgreSQL
An escape room in three acts on a real PostgreSQL compiled into the page, going as far as window functions and recursive CTEs. Free.
- SQLBolt
Eighteen short interactive lessons, including INSERT, UPDATE, DELETE and the DDL statements. SQLite, free.
- Select Star SQL
An interactive book on one real dataset, best for aggregation explained slowly. SQLite, free.
- PostgreSQL Exercises PostgreSQL
The best free drill set for joins, subqueries, aggregation, dates and strings. PostgreSQL, free.
- SQLZoo MySQL
Tutorials 0 to 12 with quizzes, strongest on NULL handling and self joins. MySQL by default, free.
- LeetCode SQL 50 MySQL
Fifty free problems with MySQL 8.0 selectable, on a server that runs, so a loose GROUP BY that passes there can fail on your own 8.4 or 9.7 install.
- HackerRank SQL MySQL
Six categories of repetition plus free skills certifications for a milestone. Pick MySQL from the dropdown; free with an account.
- MySQL Tutorial MySQL
Text tutorials for what the games skip: stored procedures, triggers, views, transactions and administration. MySQL, free.
For you as a DBA
Every site above is query practice. Creating a user, taking a backup, reading an error log or editing my.ini can only be rehearsed on the server you installed in chapter 4.
A four-week plan that follows this course
Three sessions of about 45 minutes a week. Weeks 1 and 2 need nothing installed; weeks 3 and 4 use your own MySQL.
| Week | Focus | Where |
|---|---|---|
| 1 | SELECT, filtering, joins (chapter 7) | SQLBolt lessons 1 to 12, then SQL Murder Mystery without the walkthrough, then SQL Island for your first UPDATE and DELETE |
| 2 | Aggregation and window functions (chapter 8) | The aggregation section of PostgreSQL Exercises, then LeetCode SQL 50 with MySQL 8.0 selected |
| 3 | Report queries a manager would ask for: top customers, revenue by month, films never rented | Your own MySQL (chapter 4) with the shop dataset and sakila (chapter 6) |
| 4 | DBA drills: backup and restore, users and grants, plans, logs | Your own server, following chapter 15, chapter 14, chapter 10 and chapter 16 |
Sandboxes, playgrounds and the shop dataset
A sandbox is an empty database inside a web page: you paste some DDL and a query, pick an engine and a version, and see the result. Reach for one to test a statement against an exact version, to compare 8.4 with 9.7, or to send a colleague a reproducible example. W3Schools' MySQL Tryit editor is not one of these, because it is not a MySQL server. These five were checked in September 2026.
- db<>fiddle (dbfiddle.uk) Both
MySQL 5.5 through 9.7 and PostgreSQL 8.4 through 18 side by side. Free, and the best place to test a version difference.
- SQLize Both
MySQL 8.0, 8.4 and 9.7 plus PostgreSQL 15 to 18 and MariaDB. Free, login optional.
- CompileBytes MySQL MySQL
MySQL 8.4.10 with no account, starting from a fresh database on every run. Free.
- Codapi MySQL MySQL
A server-side MySQL 9.5 sandbox with a free tier.
- phpMyAdmin demo MySQL
The phpMyAdmin web GUI over MySQL and MariaDB, reset every hour. Free; log in as root with an empty password.
Careful
Every sandbox is a public server, so never paste company table names, customer rows or a dump into one. Rebuild the shape with the shop dataset instead, and test anything that matters on 8.4 or 9.7.
That dataset ships with the course as assets/sample-shop.mysql.sql and assets/sample-shop.postgres.sql. Load it once and every example in chapters 7 to 15 becomes something you can run, break and fix on your own machine.
# MySQL: PowerShell reserves "<", so hand the redirect to cmd.exe
cmd /c "mysql -u root -p < C:\dba\assets\sample-shop.mysql.sql"
# ...or start mysql and type: source C:/dba/assets/sample-shop.mysql.sql
# PostgreSQL: psql reads a file with -f (run chcp 1252 first in a plain console)
psql -U postgres -f C:\dba\assets\sample-shop.postgres.sql
Asking an AI for syntax
An assistant has read every manual and none of your tables, so the prompt has to carry what it cannot see. Six ingredients, in the same order, whether you want a query, a script or a diagnosis.
1. Engine, version, platform: "MySQL 9.7 LTS on Windows 11, default sql_mode".
2. Schema: the CREATE TABLE statements, or every column with its type, keys and NULLs.
3. Sample rows going in, and the exact rows you expect to come out.
4. Constraints: one statement, no temporary tables, the account has only SELECT.
5. Ask for a clause-by-clause explanation and the EXPLAIN statement to run.
6. End with "what could go wrong?"
Four prompts that cover most of the week:
- A query. "MySQL 8.4, default sql_mode. Schema: [paste]. One SELECT giving paid orders and revenue per month of 2026, including months with none. Expected rows: [paste]."
- An error. "MySQL 8.4 on Windows 11. Explain ERROR 1205 lock wait timeout on an UPDATE, how it differs from a deadlock, and which sys schema query shows who holds the lock."
- A backup script. "MySQL 9.7 LTS on Windows 11, service MySQL97. A PowerShell script that dumps shop with mysqldump --single-transaction, keeps 14 days, plus the schtasks command for 02:00."
- A slow plan. "MySQL 8.4. This query takes nine seconds and here is its EXPLAIN ANALYZE: [paste]. Which single index would help most, and why?"
Ask the AI
One prompt forces the version question into the open: "MySQL 8.4 LTS. You suggested mysqlpump. Check that against the 8.4 reference manual, link the page, and tell me what the manual recommends instead."
The verification habit
An answer is a draft from a clever colleague who has never logged into your server. Read it, run it on dev, check the result, then run it for real. For anything that writes, wrap it in a transaction, count the rows you expect to change, and compare that count with the rows affected. Read the WHERE clause of an UPDATE or DELETE before you run it, every time.
START TRANSACTION;
-- 1. how many rows should change? here: only order 12
SELECT COUNT(*) FROM orders
WHERE status = 'pending' AND order_date < '2026-03-01'; -- 1
-- 2. the assistant's statement, with the same WHERE clause
UPDATE orders SET status = 'cancelled'
WHERE status = 'pending' AND order_date < '2026-03-01'; -- 1 row affected
-- 3. counts match and a spot check looks right? COMMIT. Otherwise:
ROLLBACK;
The row count is your unit test. One row affected when you expected one row is a pass; five is a rollback and a better prompt. Autocommit is on by default in both engines, so without an explicit transaction the statement is final the moment it finishes (chapter 9). In the mysql client, --safe-updates refuses an UPDATE or DELETE with no key in its WHERE clause, which is a cheap seat belt for a dev session.
Remember
Websites teach querying. A local server teaches the job. An AI types the syntax. You own the WHERE clause.
What AI is bad at here, and how you catch it
Assistants are reliable about the SQL that has been written a million times: joins, aggregates, window functions, the shape of a procedure. Three things are a DBA's home turf and the model is guessing about all of them.
| Where it slips | What it looks like | How you catch it |
|---|---|---|
| Version-specific details | Suggests mysqlpump (removed in 8.4), mysql_native_password (off in 8.4, gone in 9.0 and later) or CHANGE MASTER TO (removed in 8.4). | Ask which version added or removed it and for the manual link, open it, check the version selector, then run it on dbfiddle.uk at your version. |
| Your data | Assumes customer_id is never NULL, forgets the ENUM has a cancelled value, guesses row counts, picks a join that duplicates rows. | Paste the DDL and five sample rows with the expected output, then compare the rows and the counts you get. |
| Your privileges and environment | Assumes you are root, writes Linux paths and sudo -u postgres psql, grants more than the task needs. | Name Windows 11, the service and the account in the prompt, run the answer as that account on dev, and read every GRANT against chapter 14. |
Two habits cover most of it. Ask for the documentation link and open it, because the official manuals have a version selector. Then test on a server at your own version before you trust anything.
Reference shelf
Where to go for the truth rather than a summary. Bookmark the manual at your server's version.
- MySQL 9.7 Reference Manual
The current LTS line. The version selector at the top switches to 8.4 and 26.7.
- MySQL 8.4 Reference Manual
The older LTS that many employers still run.
- MySQL Shell 26.7
The dump and load utilities, the upgrade checker and the admin API; one Shell serves 8.4, 9.7 and 26.x servers.
- MySQL sample databases
sakila, world, menagerie, airportdb and employees for local practice.
- PostgreSQL documentation
The "current" URL always points at the latest release, 18 as of September 2026, and each page links to older versions.