SQL From Zero: Query Real Data With Confidence
by Sofia Navarro
Running totals, rankings and gaps-and-islands, explained until they finally feel obvious.
SN Created by Sofia Navarro
Every bullet below is something you will have built, shipped or be able to explain by the time you finish the last lesson.
6 modules · 40 lessons · 5h 20m of material
7 lessons running 52m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
7 lessons running 56m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
7 lessons running 58m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
7 lessons running 58m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
6 lessons running 50m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
6 lessons running 46m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.
Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.
6 modules · 40 lessons
5h 20m total length
Short list, and deliberately so. If you meet these you can start today.
Window functions are the point at which SQL stops being a way to fetch rows and becomes a way to compute. Most developers learn just enough to copy a ROW_NUMBER example and never build the mental model that makes the rest available. This course builds that model properly.
It begins with the frame, because everything else follows from it. What a partition is, how ordering defines a frame, the difference between ROWS and RANGE, and what the default frame silently does when you omit it. Every concept is shown on a small table where you can verify the output by hand.
From there you work through the function families and the problems they solve: ranking and dense ranking with an honest treatment of ties, LAG and LEAD for period-over-period comparison, running totals and moving averages, first and last value with the frame trap that catches everyone, and percentiles and buckets for distribution work.
The second half is patterns rather than functions. Gaps and islands for finding consecutive runs. Deduplication that keeps the correct row rather than an arbitrary one. Sessionisation of event streams. Cohort and retention grids. Top N per group without a correlated subquery. Each pattern is presented as a recognisable problem shape first, then solved, then stress-tested against edge cases and against a common wrong solution that looks right.
Still unsure about something? Write to misteryjj100@gmail.com and a human answers, usually the same working day.
Reviews are written by people who bought this course. We publish the critical ones too.
5.0
Rated 5.0 out of 5Course rating · 2 reviews
Ola Jørgensen
Analytics engineer
ROWS against RANGE when there is a tie in the ordering column. I had been producing subtly wrong running totals for months without knowing why, and watching the frame boundaries drawn row by row fixed it for good.
Camille Dubois
Data engineer
I had copied gaps-and-islands solutions off forums for years without understanding a single line of them. Numbering the rows twice, subtracting and grouping by the difference is one of those things that becomes obvious the moment somebody walks you through it slowly.
Python and data engineer
Sofia builds the pipelines that keep analytics teams honest, mostly Python on top of PostgreSQL under uncomfortable load. She teaches schema design, indexing and query planning against anonymised production datasets rather than toy tables, then wires the same data into pandas so the SQL and the Python halves stop being separate skills. Expect to spend real time reading execution plans and rather less time reading slides. She consults on migrations for teams that cannot afford downtime.
One-time payment · lifetime access