Hospital Revenue Cycle Management Path · Mission 2 of 25Easy

Medicare patients by demographic

Filter dim_patient on a payer attribute via the IN clause. Medicare patients are the highest-volume payer cohort for any group practice with cardiology and orthopedics; pulling them out cleanly is the first step before any payer-specific analytics.

The Brief

Maria SantosBilling Analystslack-dm

Linda wants a clean Medicare patient roster before the AR aging review. Medicare lives on two payer rows in dim_payer (payer_id 5 = Medicare, payer_id 6 = Medicare Advantage HMO), so filter dim_patient on primary_payer_id IN (5, 6). Output four columns: patient_name, date_of_birth, gender, primary_payer_id. Sort by date_of_birth ascending so the oldest patients lead (they're the longest tenured on Medicare), then alphabetical on patient_name as a stable tiebreaker.

You'll practice

WHERE filterIN clauseORDER BY

Tables & columns available

dim_patientdim6 columns
ColumnTypeKey
patient_idINTPK
patient_nameTEXT
date_of_birthTEXT
genderTEXT
primary_payer_idINTFK → dim_payer
secondary_payer_idINTFK → dim_payer

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Single-table SELECT with a WHERE filter. dim_patient has the primary_payer_id column; the IN clause covers both Medicare payer_ids in one filter.

Hint 2

No aggregation — one row per Medicare patient. Project the four columns Maria named (patient_name, date_of_birth, gender, primary_payer_id).

Hint 3

Stable two-level sort: oldest patients lead so date_of_birth ascending, with an alphabetic tiebreaker on patient_name when patients share a DOB.