Learn SQL with Phoebe

Two tracks from data-curious to query-fluent

A leader track that teaches you to read, question, and commission SQL without writing a line - and a builder track that takes you from your first SELECT to window functions, a real revenue-drop investigation, and production warehouses. Both run against one small database, Daybreak, in a live editor right in your browser. No install, no login, no server.

2tracks
16sessions
1live database
45min per session

The leader track 🀝 · for C-level, managers & curious minds · 6 x 45 min · no code to write

Thinking mode: what SQL is, how to read a query, how to judge a data claim, and how to brief an analyst - each session ends with questions to ask your data team.

The builder track πŸ› οΈ Β· for practitioners Β· 10 x 45 min Β· runs live in your browser

One database, Daybreak, queried harder every session. Every idea lands on data you already know - from your first SELECT to window functions, a real investigation, and warehouse-grade tuning.

πŸšͺ Builder 1 Β· easy

Meet your database

Run a real query in two minutes: SELECT, FROM, LIMIT, ORDER BY, and a tour of the whole Daybreak schema.

β–Ά Builders start here
πŸ” Builder 2 Β· easy

Filtering rows with WHERE

Comparison and logical operators, LIKE, IN, BETWEEN, IS NULL - asking for exactly the rows you want.

Build a segment
πŸ“ Builder 3 Β· medium

Aggregating: COUNT, SUM, GROUP BY

Collapse many rows into answers - COUNT, SUM, AVG, GROUP BY, HAVING, DISTINCT, and "per what" thinking.

Revenue per product
πŸ”— Builder 4 Β· medium

Joining tables

The relational payoff: INNER and LEFT joins, chaining three tables, self-joins - stitching Daybreak together.

Revenue per customer
🧩 Builder 5 · medium

Combining and reshaping

CASE buckets, aliases and expressions, string and date functions, UNION - reshaping results into what you need.

Monthly rollups
πŸͺ† Builder 6 Β· hands-on

Subqueries and CTEs

Queries inside queries, and WITH clauses that make multi-step logic read top-to-bottom instead of inside-out.

Readable pipelines
πŸͺŸ Builder 7 Β· hands-on

Window functions

Rank, ROW_NUMBER, LAG/LEAD, running totals and PARTITION BY - the analyst superpower, on Daybreak's revenue.

Running totals
πŸ—οΈ Builder 8 Β· hands-on

Building and changing data

CREATE, INSERT, UPDATE, DELETE, ALTER, keys and constraints, and the order queries actually execute in.

Write, not just read
πŸ•΅οΈ Builder 9 Β· hardest

Analyst case study: the March drop

A full investigation: confirm the revenue dip, drill into March, find the cause in refunds, events and cancels.

End-to-end analysis
πŸš€ Builder 10 Β· hardest

Performance and real warehouses

Reading a query plan, indexes and their tradeoffs, and the dialect deltas from SQLite to Postgres, BigQuery, Snowflake.

SQLite to production
easy - everyone medium hands-on / deciding hardest

Choose your path πŸ—ΊοΈ

Two doors, one database. Leaders never write a query; builders never sit through theory they have not just run themselves.

🀝 Leader (read & judge) a1β†’ a2β†’ a3β†’ a4β†’ a5β†’ a6
πŸ› οΈ Builder (query Daybreak) b1β†’ b2β†’ b3β†’ b4β†’ b5β†’ b6β†’ b7β†’ b8β†’ b9β†’ b10
🌱 Curious follower (a taste) a1β†’ a2β†’ b1
πŸš€ Full journey (lead AND build) a1-a6β†’ b1-b10

The knowledge map 🧠

Both tracks at a glance - hover a session to spotlight its concepts, click any node to jump in.

The whole course on one sheet πŸ“

Seven modules: both tracks, the Daybreak schema with real row counts, the clause ladder, the order SQL actually runs your query in, which join to reach for, the four traps that make an honest query mislead, and the March revenue-drop investigation.

Download for print (2800px) Every word here is real selectable text, so it stays sharp however far you zoom.

learn sql
with phoebe

Two tracks from data-curious to query-fluent
16 sessions - one database - runs in your browser, no install

SEC-01 TWO TRACKS

LEADER TRACK
read and question, no code

  1. a1What SQL actually is
  2. a2Reading a query without fear
  3. a3Judging a data claim
  4. a4The dashboard behind the dashboard
  5. a5Asking for the right cut
  6. a6SQL, warehouses and AI

BUILDER TRACK
write it yourself, live editor

  1. b1Meet your database
  2. b2Filtering rows with WHERE
  3. b3Aggregating
  4. b4Joining tables
  5. b5Combining and reshaping
  6. b6Subqueries and CTEs
  7. b7Window functions
  8. b8Building and changing data
  9. b9Analyst case study
  10. b10Performance and warehouses
Both tracks run against the same database.
2tracks
16sessions
1live database
45min per session

SEC-02 THE DAYBREAK DATABASE

customers 15

  • customer_id
  • name
  • city
  • country
  • signup_date
  • plan

orders 33

  • order_id
  • customer_id
  • order_date
  • status
  • channel

order_items 53

  • order_id
  • product_id
  • quantity
  • unit_price

products 8

  • product_id
  • name
  • category
  • price
  • roast

subscriptions 10

  • sub_id
  • customer_id
  • product_id
  • start_date
  • cancel_date
  • monthly_qty

events 10

  • event_id
  • customer_id
  • event_date
  • event_type
Bold columns are the keys a question travels on. customers to orders on customer_id  /  orders to order_items on order_id  /  products to order_items on product_id  /  customers to subscriptions and events on customer_id
Daybreak, a coffee-subscription brand. One small database, all 16 sessions.

SEC-03 THE CLAUSE LADDER

1
SELECT, FROM, LIMIT ask for columns
b1
2
WHERE, AND, OR, LIKE, IN, BETWEEN, IS NULL ask for some rows, not all
b2
3
COUNT, SUM, AVG, GROUP BY, HAVING, DISTINCT collapse rows into a number
b3
4
JOIN, LEFT JOIN, INNER JOIN stitch tables on a shared id
b4
5
CASE, UNION, aliases, date functions reshape the output
b5
6
subqueries, WITH, CTEs name your steps
b6
7
OVER, PARTITION BY, LAG, LEAD compute across rows without collapsing them
b7
8
CREATE TABLE, INSERT, UPDATE, DELETE, ALTER TABLE write, not just read
b8
How to climb it

Every rung assumes the ones below it, so climb in order. Rungs 1 to 4 already answer most day-to-day questions. Rung 7 is the one that separates people who know SQL from people who reach for SQL first.

SEC-04 THE REAL ORDER OF EXECUTION

THE ORDER YOU WRITE IT

  • SELECT5
  • FROM1
  • WHERE2
  • GROUP BY3
  • HAVING4
  • ORDER BY6
  • LIMIT7

THE ORDER SQL RUNS IT

  • FROM1
  • WHERE2
  • GROUP BY3
  • HAVING4
  • SELECT5
  • ORDER BY6
  • LIMIT7
Matching numbers are the same clause.
The consequence, on a real column
SELECT quantity * unit_price AS line_total FROM order_items WHERE line_total > 40 fails

WHERE runs at step 2, SELECT at step 5. The alias does not exist yet.

WHERE quantity * unit_price > 40 works ORDER BY line_total works

Repeat the expression, or sort by the alias: ORDER BY runs at step 6, after SELECT.

SEC-05 WHICH JOIN

INNER JOINRows that match in both. Drops customers who never ordered.
LEFT JOINEvery row on the left, matches where they exist. Keeps them, fills NULL.
SELF JOINOne table joined to itself. Compare a row to another row in the same table.
"Who never ordered" is only answerable with LEFT JOIN and IS NULL.
Chaining three tables

Money and names live in different tables, so revenue per customer needs all three. Read the joins as a path:

customers -> orders on customer_id orders -> order_items on order_id

Line revenue is quantity * unit_price, and SUM rolls it up per customer. Filter to status = 'completed' so refunds and cancels do not inflate the number.

SEC-06 WHERE HONEST NUMBERS MISLEAD

Hidden granularityGROUP BY decides "per what". Ask: per customer, per order, or per line item?
One word, three answersCOUNT, SUM and AVG tell different stories from the same rows. Ask: which one is on this slide?
Cohort versus snapshotAsk: is this everyone today, or everyone who joined in March?
A rate whose halves disagreeAsk: is the numerator's population the same as the denominator's?
Most misleading numbers are not lies. They are honest queries that answered a narrower question than the slide implies.
Worked example, from session a3

When two company reports disagree on "revenue", the most common cause is not that one is wrong. It is the same word carrying two definitions in two queries. The leader's move is to ask what each query actually counted.

SEC-07 THE MARCH REVENUE DROP

1
CONFIRM THE DROPis it real, and how big
2
DRILL INTO MARCHwhich product, which channel, which week
3
HUNT FOR CAUSESevents and cancellations
4
COHORT PEEKare we still acquiring customers
5
WRITE THE BRIEFone paragraph the founder can act on
Session b9. The founder asks one sentence: "Revenue fell in March, why?" No dashboard, just the database.
Think like an analyst, not a query-writer

The funnel is the point. Each step narrows the question the next query has to answer, which is why the last step is a paragraph rather than another chart.

learn sql with phoebe 16 sessions - 6 tables - 33 orders - 0 installs by Phoebe Fu