← All schemas
Schema Library

Hospital Management System Database Schema

A hospital management system connects patient care to billing in twelve tables. Patients book appointments with doctors; visits produce medical records; records carry prescriptions that reference a medications catalog; inpatient stays flow through admissions into rooms and beds; and every visit or stay rolls up into bills, which are settled by individual payments. Two modeling choices keep the schema tight: a single staff table covers doctors, nurses, and admin via a role column (so appointments reference staff, not doctors), and billing splits into bills (the aggregate) and payments (each settlement attempt) so partial and failed payments are representable.

Last updated: 2026-09-27

Source: Original design by dbdiagramr, modeled on standard DBMS textbook schemas

Tables
12
Core table
patients
Care flow
Patient -> Appointment -> Record -> Bill
Mini Map
Open in DBdiagramr to edit →

Tables in the Hospital Management System schema

ColumnTypeNullableKey
departments
iduuidNoPK
namevarcharNo-
buildingvarcharYes-
floorintegerYes-
patients
iduuidNoPK
first_namevarcharNo-
last_namevarcharNo-
date_of_birthdateNo-
gendervarcharYes-
blood_groupvarchar(3)Yes-
phonevarcharNo-
emailvarcharYes-
addresstextYes-
emergency_contactvarcharYes-
created_attimestamptzNo-
staff
iduuidNoPK
first_namevarcharNo-
last_namevarcharNo-
rolevarcharNo-
department_iduuidYes-
specializationvarcharYes-
phonevarcharYes-
hire_datedateYes-
rooms
iduuidNoPK
numbervarcharNo-
room_typevarcharNo-
capacityintegerNo-
beds
iduuidNoPK
room_iduuidNo-
bed_numbervarcharNo-
statusvarcharNo-
appointments
iduuidNoPK
patient_iduuidNo-
doctor_iduuidNo-
department_iduuidYes-
appointment_attimestamptzNo-
statusvarcharNo-
notestextYes-
medical_records
iduuidNoPK
patient_iduuidNo-
doctor_iduuidNo-
appointment_iduuidYes-
recorded_attimestamptzNo-
diagnosistextNo-
symptomstextYes-
treatment_plantextYes-
medications
iduuidNoPK
namevarcharNo-
unitvarcharYes-
pricenumeric(10,2)Yes-
prescriptions
iduuidNoPK
record_iduuidNo-
medication_iduuidNo-
dosagevarcharNo-
frequencyvarcharNo-
duration_daysintegerYes-
admissions
iduuidNoPK
patient_iduuidNo-
bed_iduuidNo-
admitted_attimestamptzNo-
discharged_attimestamptzYes-
admission_typevarcharYes-
bills
iduuidNoPK
patient_iduuidNo-
admission_iduuidYes-
appointment_iduuidYes-
total_amountnumeric(10,2)No-
insurance_coverednumeric(10,2)No-
statusvarcharNo-
billed_attimestamptzNo-
payments
iduuidNoPK
bill_iduuidNo-
amountnumeric(10,2)No-
methodvarcharNo-
paid_attimestamptzNo-

Frequently asked questions

What tables does a hospital management system database need?

A standard hospital schema needs departments, patients, staff, rooms, beds, appointments, medical_records, medications, prescriptions, admissions, bills, and payments - 12 tables covering scheduling, clinical care, inpatient stays, and billing.

Should doctors and nurses be separate tables?

Usually not. A single staff table with a role column (doctor, nurse, admin) plus department and specialization columns covers all personnel, and appointments can reference any staff member. Split them only when doctors and nurses need very different columns.

How are bills and payments modeled in a hospital schema?

Bills aggregate charges against a patient (optionally tied to one admission or appointment) with insurance-covered and status columns. Payments are separate rows per settlement attempt against a bill, which models partial payments and failed transactions naturally.

Explore more schemas

Visualize your own database

Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.

Try it free →