SQL from Scratch

Don’t memorize SQL. Learn to think in queries.

A story-driven, interactive SQL course where Harry asks the questions, Hermione explains the ideas, and you write the queries.

The learning loop
  1. 01Ask
  2. 02Understand
  3. 03Write
  4. 04Run
  5. 05Solve
Meet the cast

Harry asks. Hermione explains. You write the query.

Harry

Wait… why can't we just use WHERE here?

Hermione

Because WHERE filters individual rows. You're asking a question about the group.

Write. Run. Observe.

A real SQL playground, right in the lesson.

The journey

From your first SELECT to real-world analytical SQL

Eleven chapters, organized around questions Harry actually needs to answer — not a list of syntax to memorize.

  1. 00Before SQL1 lesson
  2. 01Asking Questions1 lesson
  3. 02Filtering2 lessons
  4. 03Aggregation4 lessons
  5. 04Joins3 lessons
  6. 05Subqueries2 lessons
  7. 06CTEs1 lesson
  8. 07Window Functions5 lessons
  9. 08Analytics7 lessons
  10. 09Problem Solving8 lessons
  11. 10Projects4 lessons
Practice

Every concept comes with a challenge.

The Second Highest Salary

medium

Find the second highest salary in the employees table. If there is no second highest salary, return NULL.

subqueryaggregation
The idea

You don’t learn SQL by reading SQL. You learn by asking questions, forming hypotheses, writing queries, running them, seeing what happened, and trying again.

Ready to think in queries?