Explain Your Query โ HealSync: Claims, Telemedicine, Surveys, Workforce
You have been given six tables from a hospital network, HealSync: insurance claims, telemedicine sessions, patient surveys, public-health measurements, research studies and the workforce. An interviewer wants two things from you: the answers, and the reasoning said aloud.
Work through the seventeen tasks with the book Explain Your Query beside you: each task follows one chapter, and each chapter ends with a Try It box that describes the same task. Read the tables before you query them, test the keys, and find the rows recorded twice and the sessions whose doctor does not exist. Answer the questions interviewers ask on these tables: inner against left join, WHERE against HAVING, the forms of COUNT, UNION against UNION ALL, CTE against subquery, ROW_NUMBER against RANK, and why a query is slow. Then do the take-home on the reimbursement rate, deliver two lists as you would at work, and run the ten checks before trusting a join.
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 (reimbursement_by_coverage from Task 5, claims_clean and sessions_clean from Task 8, patient_events and patient_sequence from Task 12), 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). 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 โ.