HealthNow
Healthcare / EMR
HealthNow is an electronic medical records (EMR) system used by a network of clinics and a hospital. It records patients, visits (outpatient, emergency and inpatient stays), ICD-10 diagnosis codes, lab results with reference ranges and prescriptions. Healthcare analysts use this kind of data for readmission rates, chronic-disease control, care gaps and doctor workload, all common topics in health-tech SQL interviews. All patients in the dataset are fictional.
See the HealthNow tables
HealthNow schema
All tables live in the healthnow schema, so write healthnow.clinics in your queries.
healthnow.clinics
Clinics and departments in the network.
clinic_id(INT) — PKname(VARCHAR(80))city(VARCHAR(40))clinic_type(VARCHAR(20)) — 'primary_care', 'specialty', 'hospital'
healthnow.doctors
Doctors and their specialty.
doctor_id(INT) — PKfull_name(VARCHAR(80))specialty(VARCHAR(30))clinic_id(INT) — FK → clinics.clinic_id
healthnow.patients
Registered patients (fictional).
patient_id(INT) — PKfull_name(VARCHAR(80))dob(DATE) — date of birthgender(VARCHAR(1)) — 'F', 'M', 'O'city(VARCHAR(40))registered_at(DATE)insurance_type(VARCHAR(12)) — 'private', 'government', 'self_pay'
healthnow.diagnoses
ICD-10 codes used in the network.
diagnosis_code(VARCHAR(10)) — PKdescription(VARCHAR(120))category(VARCHAR(12)) — 'chronic', 'acute', 'preventive'
healthnow.visits
One row per encounter. Inpatient visits have a discharge date.
visit_id(INT) — PKpatient_id(INT) — FK → patients.patient_iddoctor_id(INT) — FK → doctors.doctor_idclinic_id(INT) — FK → clinics.clinic_idvisit_date(DATE) — admission date for inpatient staysvisit_type(VARCHAR(12)) — 'outpatient', 'emergency', 'inpatient'diagnosis_code(VARCHAR(10)) — FK → diagnoses.diagnosis_code; primary diagnosisdischarge_date(DATE) — nullable; inpatient onlybill_amount(DECIMAL(10,2)) — INR
healthnow.lab_results
Lab tests ordered during visits, with the reference range used.
lab_id(INT) — PKvisit_id(INT) — FK → visits.visit_idtest_type(VARCHAR(20)) — 'HbA1c', 'LDL', 'Fasting glucose', 'Hemoglobin', 'Creatinine'result_value(DECIMAL(6,2))result_unit(VARCHAR(10)) — '%', 'mg/dL', 'g/dL'reference_low(DECIMAL(6,2))reference_high(DECIMAL(6,2))result_flag(VARCHAR(6)) — 'NORMAL', 'HIGH', 'LOW' as recorded by the lab systemresult_date(DATE)
healthnow.medications
Prescriptions written during visits.
med_id(INT) — PKvisit_id(INT) — FK → visits.visit_iddrug_name(VARCHAR(40))dosage_mg(INT)freq_per_day(INT)start_date(DATE)end_date(DATE) — nullable; planned end; NULL for open-ended prescriptions
Beginner (10)
- BeginnerPatients by cityOpen now
- BeginnerThe 10 oldest patientsOpen now
- BeginnerVisits in the last 30 days by type
- BeginnerChronic diagnosis codes
- BeginnerDoctors per specialty
- BeginnerHbA1c results of 6.5% or more (last 90 days)
- BeginnerEmergency visits by clinic
- BeginnerPrescriptions currently running
- BeginnerPatients registered this year
- BeginnerAverage bill by visit type
Intermediate (12)
- IntermediatePatients with the most visits (last 12 months)
- IntermediateMost common diagnoses (last 12 months)
- IntermediatePatients by age band
- IntermediateDoctor workload (last 90 days)
- IntermediateOut-of-range rate by lab test
- IntermediatePatients not seen in 12 months
- IntermediateAverage length of stay by diagnosis
- IntermediatePatients on 4 or more current drugs
- IntermediateDiabetic patients overdue for HbA1c
- IntermediateMonthly billing by clinic
- IntermediateVisits without any recorded lab result
- IntermediateDistinct patient count versus visit count per doctor
Advanced (22)
- Advanced30-day readmission rate
- AdvancedHbA1c: first vs latest result per patient
- AdvancedTypical gap between visits
- AdvancedDoctor ranking within each clinic
- AdvancedPatients with both diabetes and hypertension
- AdvancedEmergency visits: daily count and 7-day average
- AdvancedFrom diagnosis to first prescription
- AdvancedData quality: lab flags that don't match the value
- AdvancedFrequent emergency department users
- AdvancedHypertension visits with an amlodipine prescription, by doctor
- AdvancedMidnight inpatient occupancy with half-open stays
- AdvancedLatest patient/test measurement with deterministic ties
- AdvancedOverlapping prescriptions for the same patient and drug
- AdvancedLab values exactly at reference boundaries
- AdvancedClinic and diagnosis billing grouping sets
- AdvancedPatients consistently attending one clinic
- AdvancedA bounded JSON patient visit timeline
- AdvancedPatients with visits but no prescription ever recorded
- AdvancedExplain a patient history date-range lookup
- AdvancedVisits outside a doctor's current clinic
- AdvancedAdd an initially unvalidated data-quality constraint
- AdvancedInspect row-level security rather than assuming patient filters authorize
Mock interview round (5)
- AdvancedMock round 1: Clinic scorecard for last month
- AdvancedMock round 2: Diabetes control rate
- AdvancedMock round 3: Readmissions by diagnosis
- AdvancedMock round 4: Do new patients come back?
- AdvancedMock round 5: High-risk heart failure patients