SQL, explained by how the engine runs it.
Most SQL tutorials teach you clauses in the order you type them. That is why WHERE
rejecting your alias feels arbitrary, why NOT IN silently returns nothing, and why
your index is ignored. This course teaches the order the database actually executes
in — and then everything else follows.
The one idea this course is built on
You write SQL top to bottom. The database does not read it that way. Learn this order and a surprising number of "SQL is weird" moments stop being weird.
Pick a path
I need to query a database at work
Lessons 02, 04, 05, 07, 09, 12, 14. You will handle most day-to-day reporting questions confidently.
I have a data interview
Lessons 02, 09, 12, 14, 15, 22, 25, 26, 27 — then the project. Joins, windows and indexes are most of what is asked.
My query is slow
Lessons 26, 27, then 17 (sargability) and 12 (subquery rewrites). Learn to read a plan before changing anything.
I'm designing a schema
Lessons 20, 21, 22, 23, 25. Types, constraints, normal forms and safe migrations.
Ships with a real project
🛠 A 5-table retail database and 30 graded challenges
4,007 rows across customers, products, orders,
order_items and returns — deliberately imperfect: NULL cities, guest
orders with no customer, negative quantities, duplicate people, orders with no items, refunds
bigger than the order.
Then 30 questions from "list customers in Kerala" to cohort retention and a Pareto analysis. Every solution is executed against the database, so the answers are verified, not hopeful. Runs in SQLite with zero installation.
Open the project →The curriculum
Lessons teach standard SQL and call out where PostgreSQL, MySQL and SQLite differ — because you will meet all three. The project runs on SQLite so you need nothing installed, and the scripts note the Postgres/MySQL variants inline.
/ search · ← → move between lessons · progress is saved in your browser only.