When a friend asks you to teach them SQL, the instinct is to pull up a query editor and type SELECT. That works for about four minutes. What actually sticks is letting them ask a question they care about, showing them the tables, and then letting them write something wrong and see why it is wrong. Your job is to keep the loop short, not to deliver a lecture.
Find a question before you find a lesson
Ask what they would like to know about the data. Even a vague answer gives you a target, and a target changes everything: the first query becomes a means rather than an exercise. If they have no data of their own, use something with obvious stakes — a household budget export, a shelf of books and their authors, a running log.
Write their question down in plain English and keep it visible. Every clause you add should visibly answer part of it. When they lose the thread, point back at the sentence.
Show the tables before the syntax
Beginners cannot hold an invisible schema in their heads. Print a one-page diagram: table names, column names, and a line for each key. Ten minutes of pointing at boxes saves an hour of “why doesn’t this column exist”.
Then have them read a few rows of each table aloud, including a column of identifiers. Naming what one row represents is the concept that makes joins make sense, and it is worth repeating until they say it back correctly.
With the schema visible, a first session of about forty minutes looks like this:
- Draw the two tables and label the key on each.
- Ask for a plain count of rows, and let them type it.
- Add one filter, then narrow it with a second condition.
- Sort the result and take the top five.
- Have them save the file and write a one-line comment saying what it answers.
Stop there. Five small wins in one session create more momentum than a complete tour of the language, and the saved file gives the next session a starting point.
Teach joins with a question, not a diagram of circles
Overlapping circles are tidy on a slide and confusing in practice. Instead ask: “which orders have no customer record?” Then make them find the orphans with a left join and an IS NULL check. The same trick works for “which customers never ordered” — one question, one join type, one visible gap in the data.
Show duplicate keys early, on purpose. Join a table whose key repeats and let them count the rows before and after. The surprise is the lesson.
Give them a place to break things
Nothing slows learning like the fear of damaging something real. Set up a copy of the database, or an account with read-only access, and say plainly that they cannot hurt it. Then let them write a query you know will fail and read the error message together, because reading errors is half the skill and it is not taught by tutorials.
Correct their mental model rather than their punctuation. If they filter after grouping without an alias, ask what they expected the database to do — the answer usually reveals the misunderstanding, and they will fix the syntax themselves.
What to leave out
Skip query tuning, indexes, and stored procedures until they have a slow query or a real need. And resist doing the typing for them. Handing over a perfect query teaches the answer; sitting on your hands while they struggle teaches the method.
Good teaching is mostly pacing: one question, one table, one small failure, one saved file. Do that a handful of times and they will be able to sit down alone without you, which is the only outcome that counts.