SQL has this peculiarity: it is not learned by watching. A query is understood when you write it, get it wrong, and see three rows come back instead of thirty. But first you need a database to query.
SQL is one of the most approachable languages you can teach: its syntax reads almost like a sentence, and a beginner produces a useful query within minutes. The obstacle lies elsewhere.
Before writing a single SELECT, you need a database at hand. And that is where SQL courses lose their first half day:
DELETE ruins the dataset for the whole group.The simplest answer is to give everyone their own database, in their browser, already populated. Nobody installs anything, nobody breaks anyone else's work, and an unfortunate DROP TABLE costs one page reload.
The choice of dataset weighs on a course's success more than people imagine. Too rich a database forces you to explain the business before the language; too poor a one allows no interesting join.
The model that works everywhere fits in four tables: customers, products, orders, and the lines of those orders. Everyone grasps the meaning without preamble, and that structure is enough to cover the essentials:
Keep the volume modest: about ten rows per table. A result you can read in full on screen lets learners check for themselves that the query did what they thought.
The classic textbook progression follows the order of the syntax. The order that works in a classroom follows actual difficulty instead — and that is not where you would expect.
Start with reading, not writing. A ready-made query, run and observed, installs the key idea: a query returns a table. Then have them modify it — change a city, add a sort — before asking for one from scratch.
Introduce joins early. It is counter-intuitive, but the join is the heart of SQL and the source of most dead ends. Pushing it to the end of the course suggests the rest is settled, while half the group stalls on the first one.
Save GROUP BY for last. Grouping demands thinking in sets rather than rows: a genuine conceptual leap that deserves time and visual examples.
Three misunderstandings turn up in every group, at any level. Anticipating them saves an hour.
FROM, no linking condition, and the query returns the product of every row. The result is enormous and nobody understands why. Show it deliberately once: it is the most effective demonstration there is.These three share one trait: the query does not crash. It silently returns a wrong result. Hence the importance of a dataset small enough to check by eye.
SQL lends itself particularly well to collective correction: a query fits in a few lines, and the result is immediately visible to everyone.
The most effective setup is to project your own screen while everyone works in theirs. You write a query, it appears on their side; they adapt it without retyping from memory. When correcting, show the expected result first — the table, not the query. The group then looks for the path, which is exactly the exercise.
Keep the solution written in advance but hidden, and reveal it only afterwards. A solution visible too early turns a reasoning exercise into a copying exercise.
A database in the browser covers everything you query. It does not cover what you administer, and that distinction is better stated plainly to the group.
Still to be handled in a real environment: rights and users, backups, optimisation and indexes at serious volumes, concurrent transactions, and dialect differences between engines. These topics belong to the administrator's craft more than to writing queries.
For an introduction, a refresher, or a SQL module inside a broader course, the browser is more than enough — and it frees the half day that went into installing.
Installing an environment on twenty machines eats the start of every session. Here is how to write and run code in the browser, what it genuinely allows, and where the limits are.
Getting startedAn exercise written once should serve ten times. Here is how to build a bank you can actually find things in, without spending more time than you save.
FacilitationThe plan written for a file and the one kept in front of you in class do not contain the same things. Here is how to write the second.
Create your first interactive room in under 5 minutes. Free plan, no credit card.
Get started for free