Learn healthcare data by querying the real thing.
Short SQL exercises on public Medicare data from CMS. You don't need to install anything or sign up. Everything runs in your browser.
Start exercise 1 →Who it's for
Career-switchers and new analysts who know some SQL, or want to learn it, and need to understand how US healthcare data is shaped: providers, codes, claims and payments.
How lessons work
Each exercise asks one question about the data. Write a query in the editor (DuckDB SQL, with autocomplete for table and column names), press Run to see results, then Check answer. The checker compares your result with the reference answer and tells you what's different: columns, row count or the first row.
How XP works
Solve an exercise on your first check for 10 XP, after one hint for 7 XP, or after more tries for 5 XP. Every 20 XP is a level. Your progress is saved in this browser, and you can export or import it as a file.
The exercises
- Filter by specialty · SELECT and WHERE
- Count providers by specialty · GROUP BY and COUNT
- Medicare payments by city · SUM and ROUND
- Top 10 providers by beneficiaries · ORDER BY, LIMIT and NULLs
- Join to HCPCS Level II descriptions · JOIN
- Which specialties bill drug J codes? · COUNT(DISTINCT) across a join
- Flu shot administration by specialty · Filter on code, entity type and specialty
Course: How a Claim Gets Paid
New to healthcare billing? This course follows a claim from the visit to the payment and the patient's bill, in plain language, with SQL practice along the way. Start the course →
Healthcare data concepts
New to the codes? Start here. Each explainer links to the CMS or CDC source.
- NPI (National Provider Identifier)The 10-digit ID every US health care provider uses on claims.
- ICD-10-CM and ICD-10-PCSDiagnosis codes (CM) and inpatient hospital procedure codes (PCS).
- HCPCS (Level I and Level II)The code system for what was done or supplied: services, drugs, equipment.
- NDC (National Drug Code)The product code that identifies a specific drug package.
- Claims: professional vs institutionalTwo kinds of bill: one from clinicians, one from facilities.
- Medicare Parts A, B and DHospital insurance, medical insurance and drug coverage.
- Place of serviceA two-digit code for where a service happened.
- Taxonomy and specialtyHow a provider's type and specialty are classified.