
🎓 Student Projects (College Reports) · Database ERD
The database behind a hospital management system: patients, doctors and departments, appointments, admissions to wards and beds, prescriptions, lab tests and bills.
Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.
Drawing diagram…
ER diagram for a hospital management system: patients, doctors with departments, appointments between a patient and a doctor, admissions to wards and beds, prescriptions with medicines, lab tests and their results, and bills with payments. Show keys and relationships.
erDiagram
DEPARTMENT ||--o{ DOCTOR : "employs"
DEPARTMENT ||--o{ WARD : "manages"
PATIENT ||--o{ APPOINTMENT : "schedules"
PATIENT ||--o{ ADMISSION : "undergoes"
PATIENT ||--o{ PRESCRIPTION : "receives"
PATIENT ||--o{ LAB_TEST : "ordered_for"
PATIENT ||--o{ BILL : "billed_to"
DOCTOR ||--o{ APPOINTMENT : "conducts"
DOCTOR ||--o{ PRESCRIPTION : "authorizes"
DOCTOR ||--o{ LAB_TEST : "requests"
WARD ||--o{ BED : "contains"
BED ||--o{ ADMISSION : "allocated_to"
PRESCRIPTION ||--o{ PRESCRIPTION_ITEM : "includes"
MEDICINE ||--o{ PRESCRIPTION_ITEM : "specified_in"
LAB_TEST ||--o{ LAB_RESULT : "produces"
BILL ||--o{ PAYMENT : "settled_by"
ADMISSION ||--o{ BILL : "generates"
DEPARTMENT {
uuid id PK
string name
string code
string location
timestamp created_at
}
DOCTOR {
uuid id PK
uuid department_id FK
string first_name
string last_name
string license_number
timestamp created_at
}
PATIENT {
uuid id PK
string national_id
string first_name
string last_name
date date_of_birth
timestamp created_at
}
APPOINTMENT {
uuid id PK
uuid patient_id FK
uuid doctor_id FK
timestamp scheduled_at
string status
timestamp created_at
}
WARD {
uuid id PK
uuid department_id FK
string name
string ward_type
timestamp created_at
}
BED {
uuid id PK
uuid ward_id FK
string bed_number
string status
timestamp created_at
}
ADMISSION {
uuid id PK
uuid patient_id FK
uuid bed_id FK
timestamp admitted_at
timestamp discharged_at
timestamp created_at
}
MEDICINE {
uuid id PK
string code
string name
decimal unit_price
timestamp created_at
}
PRESCRIPTION {
uuid id PK
uuid patient_id FK
uuid doctor_id FK
timestamp issued_at
string status
timestamp created_at
}
PRESCRIPTION_ITEM {
uuid id PK
uuid prescription_id FK
uuid medicine_id FK
string dosage
integer quantity
timestamp created_at
}
LAB_TEST {
uuid id PK
uuid patient_id FK
uuid doctor_id FK
string test_name
string status
timestamp created_at
}
LAB_RESULT {
uuid id PK
uuid lab_test_id FK
string result_value
string reference_range
timestamp recorded_at
timestamp created_at
}
BILL {
uuid id PK
uuid patient_id FK
uuid admission_id FK
decimal total_amount
decimal tax_amount
timestamp created_at
}
PAYMENT {
uuid id PK
uuid bill_id FK
decimal amount
string payment_method
timestamp paid_at
timestamp created_at
}An entity relationship diagram with 14 tables, 80 columns and 17 relationships.
Describe your own system in plain English and the AI ER diagram generator draws it in seconds, in the same style as this template.
Who uses a college library system and what each of them can do: members, the librarian and the system administrator.
The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.
How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.
The main classes of a library system with attributes, methods and UML relationships.
The steps when a member borrows a book: checks, loan record and the copy status update.
What students, examiners and the administrator do in an online examination system.