Field note · July 4, 2023

Cutting a lesson down — The patterns that keep coming up

A short catalogue of the query shapes that appear in real work over and over — cohorts, funnels, running totals, deduplication, pivots — with the version that actually works.

1 min read ·Analytics engineering ·practice

A note from writing The patterns that keep coming up, which took three passes to get to something short.

A short catalogue of the query shapes that appear in real work over and over — cohorts, funnels, running totals, deduplication, pivots — with the version that actually works.

The hard part of writing this was cutting it. The first version covered every case; the useful version covers the case you hit on a Tuesday and names the rest in a sentence. Completeness is a property of reference material, not of teaching material, and confusing the two produces something nobody finishes.

It sits in the SQL that survives production module, and the exercise runs against saas-subscriptions. 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 Writing SQL people can read, and reading the plan and leads into Testing data like you test code, 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.