playground explore freely · no grades
SQL Playground
Explore any Runtime dataset with SQL. Nothing here affects course progress.
Three years of synthetic patient journeys: patients, clinicians, appointments, visits, diagnoses, prescriptions, vital signs, lab results and procedures. No real person’s health information is present.
119,394 rows8 tables2022-07 – 2025-06
tables
Open a table to see what one row means, its columns and keys, and a preview. Start from encounters: it is the dataset's central table.
patients3,200 rows · 9 columns
One fictional patient.
- patient_id
Patient key
- first_name
Fictional given name
- last_name
Fictional family name
- sex
F or M (as recorded at registration)
- birth_date
Date of birth
- city
Home city
- state
Home state
- insurance_type
commercial, medicare, medicaid or self_pay
- deceased_date
Date of death; NULL if alive at the end of the data
providers460 rows · 6 columns
One clinician.
- provider_id
Provider key
- full_name
Fictional name
- specialty
Clinical specialty
- clinic_name
Practice or facility
- city
Practice city
- state
Practice state
encounters20,447 rows · 9 columns
One patient visit (clinic, telehealth, urgent care, emergency, or hospital stay).
- encounter_id
Encounter key
- patient_id
Patient
- provider_id
Attending provider
- encounter_class
wellness, ambulatory, telehealth, urgent_care, emergency or inpatient
- start_at
Visit start (local time)
- end_at
Visit end or discharge (local time)
- reason_code
Diagnosis code for the visit reason; NULL for routine wellness visits
- total_cost
Billed amount in USD
- payer_paid
Amount covered by insurance in USD
appointments19,438 rows · 7 columns
One booked appointment. Completed appointments link to the visit they produced.
- appointment_id
Appointment key
- patient_id
Patient
- provider_id
Provider booked
- booked_at
When the appointment was made
- scheduled_start
Appointment time
- status
completed, cancelled, no_show or scheduled (future)
- encounter_id
Resulting encounter for completed appointments; NULL otherwise
conditions8,563 rows · 7 columns
One diagnosis recorded for a patient. Chronic conditions have no resolved date.
- condition_id
Condition key
- patient_id
Patient
- encounter_id
Encounter where it was recorded
- code
Diagnosis code
- description
Diagnosis
- onset_date
Onset date
- resolved_date
Resolution date; NULL for ongoing conditions
medications19,275 rows · 8 columns
One prescription fill period. Repeat fills of the same drug can overlap or leave gaps.
- medication_id
Prescription key
- patient_id
Patient
- encounter_id
Prescribing encounter
- medication_name
Generic drug, strength and form
- start_date
First day of supply
- stop_date
First day the fill no longer covers; NULL if still open
- days_supply
Days of medication dispensed
- cost
Dispensed cost in USD
observations39,529 rows · 8 columns
One measurement: vital sign or lab result.
- observation_id
Observation key
- patient_id
Patient
- encounter_id
Encounter
- observed_at
Measurement time
- code
Measurement code (for example BP_SYS, HR, BMI, A1C)
- description
Measurement name
- value
Result; NULL when the measurement was attempted but not obtained
- unit
Unit of measure
procedures8,482 rows · 7 columns
One procedure, test or vaccination performed during an encounter.
- procedure_id
Procedure key
- patient_id
Patient
- encounter_id
Encounter
- performed_at
Time performed
- code
Procedure code
- description
Procedure
- cost
Billed amount in USD
relationships
How to join these tables. Left column matches the right column.
- encounters.patient_id joins to patients.patient_id
- encounters.provider_id joins to providers.provider_id
- appointments.patient_id joins to patients.patient_id
- appointments.provider_id joins to providers.provider_id
- appointments.encounter_id joins to encounters.encounter_id
- conditions.patient_id joins to patients.patient_id
- conditions.encounter_id joins to encounters.encounter_id
- medications.patient_id joins to patients.patient_id
- medications.encounter_id joins to encounters.encounter_id
- observations.patient_id joins to patients.patient_id
- observations.encounter_id joins to encounters.encounter_id
- procedures.patient_id joins to patients.patient_id
- procedures.encounter_id joins to encounters.encounter_id