Field note · October 10, 2025
Reader question — Window functions, properly
The single highest-leverage thing to learn in SQL. Running totals, rankings, period-over-period, deduplication, sessionisation — all of it collapses into one construct.
Reader question on Window functions, properly, and the answer belongs somewhere more findable than an email.
The single highest-leverage thing to learn in SQL. Running totals, rankings, period-over-period, deduplication, sessionisation — all of it collapses into one construct.
The question was, roughly, "when does this stop applying?" — which is the right question and the one lessons routinely fail to answer. Every technique has a range of validity, and stating it is what separates a lesson from a recipe.
It sits in the SQL that survives production module, and the exercise runs against ride-hail-trips. That pairing is deliberate: the dataset was built with the trap the lesson describes already in it, so the exercise fails in the instructive way rather than the confusing one.
Ordering matters here more than in most courses. It follows Joins that do not fan out and leads into Writing SQL people can read, and reading the plan, and reading it out of sequence mostly works but costs you the setup.
Free means free, and it also means we can rewrite it whenever it is wrong. No edition, no errata PDF, nothing to repurchase. The whole course is 36 lessons and the fixes land the day we find them.