Follow the Money โ Clearstone: Budget, Receivables, Cash
Someone has sent you four files from a company's books and one question: is the company in good shape? Clearstone has a budget of a thousand lines, a ledger of a thousand invoices, a thousand cash movements and five departments. Answer the question with SQL, and then make the answer reach the people who have to act on it.
Work through the seventeen tasks with the book Follow the Money beside you: each task follows one chapter, and each chapter ends with a Try It box that describes the same task. Ask the tables for exactly the rows you want, total and group them, age the invoices from their due dates, join the budget to its departments and build questions from other questions. Then find what the books get wrong (a reversal, a status column that disagrees with the dates, due dates that run to 2041, a department with no budget), log every decision, save the rules as views, and build the finance scorecard. Finally present it: the reader and the decision, the story, a report, a dashboard or a single number, and charts that do not mislead.
The project is one notebook for the whole book. Add each chapter's blocks below the previous chapter's, in order, and assign them to that chapter's task. Later tasks read objects built by earlier ones (cleaning_decisions from Task 9, the views clean_budget and invoices from Task 10, finance_scorecard from Task 11), so keep the blocks that create an object above the blocks that use it. Each task asks you to save a table or a view with a name like ch01_reversal, and its automatic check reads it. The as-of date for everything time-based is 1 January 2027, written as DATE '2027-01-01'. Views and tables you create are gone after a page reload until you press Run all, so after reopening the project press Run all before running anything else.
You need no SQL to start: the book teaches it from the first query. Your notebook is the deliverable: assign every block to its task, write the notes each task asks for, run the automatic checks, press Run all until it passes from top to bottom, and submit.
Real SQL (DuckDB) and real Python (pandas) run entirely in your browser โ nothing to install, and your data never leaves it. โถโถ Run all replays the whole notebook top-to-bottom; a clean pass marks the published repo as reproducible โ.