Field note · March 11, 2025

Reader question — Writing SQL people can read, and reading the plan

The query you write twice a year is written for the machine. The one in a production model is written for the person debugging it at 3am, who might be you.

1 min read ·Analytics engineering ·practice

Reader question on Writing SQL people can read, and reading the plan, and the answer belongs somewhere more findable than an email.

The query you write twice a year is written for the machine. The one in a production model is written for the person debugging it at 3am, who might be you.

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. The exercise is a thinking one rather than a query one — some of this material is about deciding what to compute, and that does not need a keyboard.

Ordering matters here more than in most courses. It follows Window functions, properly and leads into The patterns that keep coming up, 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.