Can I Trust This Data? โ Agricultural Exports, Prices and Technology
A client has sent three spreadsheets: exports by country, commodity and year; daily commodity prices; and technology adoption on a hundred farms. They want to know what the data says about prices and trade, and what the exports were worth. Before it can say anything, you have to decide whether it can be trusted.
Work through the seventeen tasks with the book Can I Trust This Data? beside you: each task follows one chapter, and each chapter ends with a Try It box that describes the same task. Profile every table before you query it. Find the duplicate rows, the missing values and rows, and the values that are wrong but look right. Standardize the spellings, check the data against the business rules and the country master, and record every issue in a log. Build the clean views without altering the raw tables. Then join exports to an annual price, measure how prices and tonnage changed, design a data-quality dashboard, write the analysis up, and name the causes of the faults.
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 views built by earlier ones (country_aliases from Task 8, quality_issues from Task 10, exports_clean, prices_clean and technology_clean from Task 11, export_value from Task 12, price_by_year from Task 13), so keep the blocks that create a view above the blocks that use it. Where a task asks you to save a number as a view named like ch01_answer, its automatic check reads that view. Views 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 basic SQL (SELECT, WHERE, GROUP BY). 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 โ.