Intro to SQL
Learn to query a real dataset in SQL — 15 short lessons against the Chinook digital music store.
What you'll build
- 01 Fluency in single-table SQL — projection, filter, sort, dedupe, pattern match.
- 02 Summarization queries with aggregates, GROUP BY, and HAVING.
- 03 Multi-table joins (INNER, LEFT) and subqueries to answer cross-table questions.
- 04 A capstone set of business-question queries against the full Chinook schema.
15 lessons across 3 phases.
- 01 Setup + first SELECT lesson_setup
Open Chinook, write your first query, and see rows come back.
- 02 Picking columns + aliases lesson_columns
Stop using `*`. Pick the columns you actually want and rename one with `as`.
- 03 WHERE filtering lesson_where
Stop pulling every row. Filter to just the ones you want with `where`.
- 04 NULL handling lesson_nulls
Find rows where data is missing — and learn why `= null` doesn't work.
- 05 ORDER BY + LIMIT lesson_order-limit
Sort rows deliberately, then take the top N.
- 06 DISTINCT lesson_distinct
Collapse duplicate values down to the unique set with `distinct`.
- 07 Pattern matching with LIKE lesson_like
Find rows by partial string match using `%` and `_` wildcards.
- 08 Aggregates lesson_aggregates
Collapse many rows into one summary row with count, sum, avg, min, max.
- 09 GROUP BY lesson_group-by
Roll up aggregates per category — one summary row per group.
- 10 HAVING lesson_having
Filter grouped rows themselves — `where` runs before aggregation, `having` runs after.
- 11 Two-table INNER JOIN lesson_inner-join
Combine `Customer` and `Invoice` on a matching column — the moment a question spans two tables.
- 12 LEFT JOIN — finding what's missing lesson_left-join
Use LEFT JOIN to keep every row from the left table, then filter for NULLs to find rows with no match on the right.
- 13 Multi-table JOIN lesson_multi-join
Chain three or more tables with a sequence of INNER JOINs, each linking to the previous one through a foreign key.
- 14 Subqueries lesson_subqueries
Run a query inside another query — use `in (select …)` to filter one table by a list of values another query produced.
- 15 Capstone lesson_capstone
Five real business questions, no per-step scaffolding. Verify gates on question 1 (top 5 genres by revenue); the other four are yours to write and check in sqlite3.
What you need before you start.
- Terminal comfort
- You can cd into a directory, run commands, and edit a file in an editor.
- Node 22+ and pnpm
- Installed by the workshop entry skill if missing. No prior Node experience needed.
- SQLite CLI
- Preinstalled on macOS. One-line install on Linux/Windows; the workshop walks you through it.
Two lines to start.
Run the first in your shell. Run the second from inside Claude Code, in plain English.
First time here?
You'll need the lwc CLI and the Claude Code plugin
installed once before the two lines below will work.
Full walkthrough →