Free through lesson 3

Database Fundamentals with MySQL

A course for getting out of the state where you patch copy-pasted SQL until it works. SELECT and WHERE, NULL and three-valued logic, the difference between JOIN and LEFT JOIN, window functions, transactions and locks, normalisation, indexes and EXPLAIN. Thirty lessons that take you to explaining why a query returns what it returns.

Curriculum

The 30 lessons are grouped into six chapters. Working through them in order is the best way, but you are welcome to read only the part you are stuck on right now. Note: SQL cannot run inside the browser. Install MySQL 8.4 (or 8.0), load the sample data from lesson 1, and try it there.

Chapter 1 — Getting MySQL running (lessons 1–3)

Connecting, creating a database and tables, and putting rows in and getting them back. The sample data you build here stays with you until lesson 30.

Chapter 2 — Getting SELECT under control (lessons 4–8)

Choosing columns and aliasing them, WHERE conditions, LIKE patterns, and NULL. You go down to three-valued logic to see why "= NULL" never matches, then finish with ordering and pagination.

Chapter 3 — Aggregating and joining (lessons 9–15)

From the fact that COUNT skips NULL through GROUP BY and HAVING, and then into JOIN. INNER against LEFT, what happens when ON and WHERE get mixed up, self joins, subqueries and CTEs.

Chapter 4 — Functions and changing data (lessons 16–19)

Writing "rank within each group" in a single statement with window functions, walking into the traps around dates and times, INSERT in practice, and running UPDATE and DELETE safely.

Chapter 5 — Designing so it does not break (lessons 20–24)

Transactions and locks, and how to read a deadlock. Then choosing data types, primary and foreign keys, and normalisation — the decisions that are hardest to change later.

Chapter 6 — Speed and operations (lessons 25–30)

When an index helps and when it cannot, how to read EXPLAIN, character sets and collations, privileges and backups, and connecting from an application. It ends by running design through to implementation.

Once you have finished all 30 lessons, see the same material through PostgreSQL in Database Fundamentals with PostgreSQL. To drive it from an application, continue with Django or FastAPI. Membership unlocks every course.