a study series by Kim · beginner → data engineer

SQL Quest

I'm learning SQL in public, from my first SELECT to building a data warehouse. Every episode is one study session: a story, a hands-on lab, diagrams, a quiz, and a cat who sleeps through all of it.

21 episodes·3 worlds·PostgreSQL
0/21 episodes

the study room · open 24/7 · cat not included in the price

How every episode works

Same shape every time, so you always know where you are.

📖 storyEach topic starts with the problem it solves, told like a game level, with a cliffhanger at the end.
🧪 labReal commands on PostgreSQL with real output from my terminal, mistakes included.
📊 diagramsOne picture per big idea: execution plans, joins, windows, before vs after.
⚖️ compareSide by side: RANK vs DENSE_RANK, Seq Scan vs Index Scan, PostgreSQL vs MySQL.
🛠 DE angleWhere this shows up in real data pipelines and dashboards at work.
💾 save pointsCat tips, hover-to-learn keywords, a glossary and a quiz to lock it in.
beginner

World 1 · Speak SQL

From your first SELECT to building your own tables. By the end you can answer real business questions on your own.

ep 00play ▸

A Short Story of SQL

Why SQL exists: Codd, SEQUEL, the optimizer, and the language that refused to die.

no lab · history + quiz
ep 01soon

Your first query

Install PostgreSQL + DBeaver, load a sample shop, and run SELECT, FROM and LIMIT.

lab: load the shop database
ep 02soon

Asking better questions

WHERE, AND / OR, IN, BETWEEN, LIKE, ORDER BY, and the NULL trap.

lab: find the "lost" orders
ep 03soon

Tables that talk

INNER / LEFT / FULL JOIN, anti-joins, and stacking results with UNION, INTERSECT, EXCEPT.

lab: customers who never ordered
ep 04soon

The function toolbox

String, number and date functions, CASE logic, COALESCE and clean NULL handling.

lab: clean a messy customer list
ep 05soon

Counting things

COUNT, SUM, AVG, GROUP BY, HAVING: turning rows into answers.

lab: revenue per country
ep 06soon

Build your own tables

DDL vs DML, data types, PRIMARY / FOREIGN KEY, transactions with COMMIT and ROLLBACK.

↳ my SQL2 noteslab: design a mini retail schema
intermediate

World 2 · Think like the database

Stop guessing why a query is slow or wrong. Learn what the engine actually does, and the tools pros use every day.

ep 07soon

What happens after Enter

Parser → optimizer → executor, execution order, and reading your first EXPLAIN.

↳ my SQL2 noteslab: EXPLAIN five queries
ep 08soon

Queries inside queries

Subqueries, CTEs, WITH RECURSIVE, and temp tables.

lab: build an org chart
ep 09aplay ▸

Window Saga 1 · See Through the Window

Keep every row, still see the big picture: OVER, PARTITION BY, ORDER BY, frames and the 4 window rules.

↳ studied 16 Nov 2026lab: the three-level report
ep 09bplay ▸

Window Saga 2 · Sum It Up

Totals that never forget the details: COUNT, SUM, AVG, MIN, MAX over windows, running and rolling totals.

↳ studied 17 Nov 2026lab: the data health check
ep 09csoon

Window Saga 3 · Stand on the Podium

Who's #1, and what happens on a tie? ROW_NUMBER, RANK, DENSE_RANK, NTILE, CUME_DIST, PERCENT_RANK.

lab: keep the latest, crown the best
ep 09dsoon

Window Saga 4 · Step Back, Step Ahead

Compare today with yesterday: LAG, LEAD, FIRST_VALUE and LAST_VALUE.

↳ my sql3 noteslab: the price detective
ep 10soon

Code that lives in the DB

Views, functions, stored procedures and triggers, and when not to use them.

↳ my SQL2 noteslab: an auto updated_at trigger
ep 11soon

Make it fast

B-tree, composite, partial and GIN indexes, why an index is ignored, EXPLAIN ANALYZE.

↳ my SQL_1 noteslab: the 145× index, extended
advanced

World 3 · SQL for Data Engineers

The SQL that runs pipelines: modeling, safe loading, concurrency, big tables and the modern data stack.

ep 12soon

Shaping data

Normalization vs star schema, fact and dimension tables, surrogate keys.

lab: model a fact_SalesLine
ep 13soon

Many users at once

Transactions, isolation levels, locks and MVCC.

lab: two terminals, one row
ep 14soon

Loading data safely

COPY, upserts with ON CONFLICT, idempotent loads, SCD Type 2.

lab: a rerunnable daily load
ep 15soon

SQL for analytics

Exploratory data analysis, running totals, cohorts and segmentation in pure SQL.

lab: a customer report in one query
ep 16soon

SQL in the modern stack

dbt models and tests, SQL from Python, warehouse SQL in Microsoft Fabric.

lab: your first dbt project
BOSSsoon

Boss level: build a SQL data warehouse

Raw → staging → star schema → dashboard, end to end, on my home database server.

capstone project

My study loop

How one study session becomes one episode.

1 · studyLesson + lab with my AI study buddy. Every question and error gets written down.
2 · report"taki taki" → a bilingual task report in my Notion learning hub.
3 · buildThe report becomes an episode page: story, lab, diagrams, quiz.
4 · shipgit push → live on datawithkim.dev via GitHub Pages.
5 · shareA short post linking the episode, so others can learn along.

Watch-along

Prefer video? This free course covers most of the same ground and pairs well with the labs here.

// video · Data with Baraa

SQL Full Course for Beginners (30 Hours): From Zero to Hero. Basics, joins, functions, window functions, CTEs, procedures, performance, EDA and a data warehouse project. Different database engine than mine in places, so expect small syntax differences.