Sample healthcare data
Updated 3 November 2026. Fictional U.S. businesses and people, generated with a fixed seed.
What is in it
Each row is one fictional hospital stay in 2024: admission and discharge dates, length of stay, age, sex, ward, admission type, insurance type, billed charges and whether the patient came back within 30 days. No real patients or hospitals; the numbers are made up for practice.
More practice tables like this one: all 14 newer sample datasets.
First rows
point at a column to light it up
| patient_idtext | admission_datedate | discharge_datedate | length_of_staynumber | agenumber | sextext | departmenttext | admission_typetext | insurancetext | total_chargesnumber | readmitted_30dyes/no |
|---|---|---|---|---|---|---|---|---|---|---|
| PT80001 | 2024-08-08 | 2024-08-16 | 8 | 44 | M | Surgery | Emergency | Medicaid | 45894.62 | FALSE |
| PT80002 | 2024-10-22 | 2024-10-29 | 7 | 50 | F | General Medicine | Urgent | Private | 24619.37 | FALSE |
| PT80003 | 2024-07-23 | 2024-07-28 | 5 | 9 | M | Pediatrics | Emergency | Private | 23136.61 | TRUE |
| PT80004 | 2024-03-07 | 2024-03-09 | 2 | 47 | F | Surgery | Urgent | Self-pay | 17956.7 | FALSE |
| PT80005 | 2024-02-06 | 2024-02-07 | 1 | 15 | M | Pediatrics | Elective | Private | 3810.9 | FALSE |
| PT80006 | 2024-04-12 | 2024-04-18 | 6 | 60 | F | Orthopedics | Elective | Medicare | 53817.4 | FALSE |
| PT80007 | 2024-07-11 | 2024-07-16 | 5 | 17 | M | Pediatrics | Elective | Medicaid | 13154.48 | FALSE |
| PT80008 | 2024-08-23 | 2024-08-29 | 6 | 50 | M | Orthopedics | Emergency | Medicare | 55314.7 | FALSE |
| PT80009 | 2024-11-06 | 2024-11-11 | 5 | 57 | F | Surgery | Emergency | Medicaid | 29598.78 | FALSE |
| PT80010 | 2024-07-16 | 2024-07-22 | 6 | 57 | M | General Medicine | Urgent | Private | 26808.1 | FALSE |
Average length of stay by ward
days, 1,000-row file
Show as a table
| department | value |
|---|---|
| Neurology | 6.1 |
| Surgery | 5.5 |
| Cardiology | 5.0 |
| General Medicine | 4.8 |
| Orthopedics | 4.3 |
| Pediatrics | 3.3 |
| Maternity | 2.9 |
Data dictionary
| Column | Type | Meaning |
|---|---|---|
| patient_id | text | Fictional patient number (no real patients) |
| admission_date | date | Admitted (2024) |
| discharge_date | date | Discharged |
| length_of_stay | integer | discharge_date - admission_date, in days |
| age | integer | Age at admission |
| sex | text | F or M |
| department | text | Ward that admitted the patient |
| admission_type | text | Emergency, Urgent or Elective |
| insurance | text | Medicare, Medicaid, Private or Self-pay |
| total_charges | decimal | Billed charges (USD, fictional) |
| readmitted_30d | boolean | Readmitted within 30 days (TRUE/FALSE) |
Practice questions
answers checked in SQL and in Python
Average length of stay by ward (days)?
Neurology 6.1; Surgery 5.5; Cardiology 5.0; General Medicine 4.8; Orthopedics 4.3; Pediatrics 3.3; Maternity 2.9
Excel
=AVERAGEIF(G:G,"Surgery",D:D)SQL
SELECT department, ROUND(AVG(length_of_stay),1) AS los FROM hospital_patients GROUP BY department ORDER BY los DESC, departmentFile: hospital-patients-1000
30-day readmission rate?
7.2%
Excel
=COUNTIF(K:K,TRUE)/1000SQL
SELECT ROUND(100.0*SUM(readmitted_30d)/COUNT(*),1) FROM hospital_patientsFile: hospital-patients-1000
Admissions by insurance type?
Private 453; Medicare 245; Medicaid 229; Self-pay 73
Excel
=COUNTIF(I:I,"Medicare")SQL
SELECT insurance, COUNT(*) AS n FROM hospital_patients GROUP BY insurance ORDER BY n DESC, insuranceFile: hospital-patients-1000