---
title: "ER diagram: hospital management"
subject: "Database Management System"
chapter: 2
key: "semester_6/database_management_system:er-hospital"
source: https://www.bctengineer.com/q/semester_6/database_management_system/er-hospital
site: BCT Engineering
---

# ER diagram: hospital management

Database Management System · Chapter 2: Data Models

- Asked in: 2072 Ashwin
- Video: [How to draw ER diagram for hospital management system?(Dbms)](https://www.youtube.com/watch?v=fWqPRSwGR_I) — MADE_EASY_FOR_YOU
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/database_management_system/er-hospital
- Whole chapter: https://www.bctengineer.com/md/semester_6/database_management_system/chapter-2

## Question

Draw an ER diagram for a hospital. [The question text is not printed; the page gives only the label and the solution diagram: Staff (attributes overtime, rate) is specialized by ISA into HA and Doctor; part-time staff are paid; Doctor is assigned to Patient; HA attends Patient; Patient (attribute req_treatment) is treated in a Ward; Ward is associated to HA; Patient takes Drugs (attributes no_of_time, length).]

## Short answer

Entities: Staff (overtime, rate) ISA Doctor and HA; Patient (req_treatment); Ward; Drugs. Relationships: Doctor assigned to Patient (1:N), HA attends Patient (M:N), Patient treated in Ward (N:1), Ward associated to HA (1:N), Patient takes Drugs (M:N) with attributes no_of_time, length.

## Answer

The hospital ER diagram uses a specialization (ISA) hierarchy and several relationships with attributes.

#### Entities and attributes
- **Staff** (staff_id, name, *overtime*, *rate*): part-time staff are paid by rate.
- **HA** (health assistant) and **Doctor**: subclasses of Staff (ISA).
- **Patient** (patient_id, name, *req_treatment*).
- **Ward** (ward_no, name).
- **Drugs** (drug_id, name).

#### Relationships
- Doctor **is assigned to** Patient (1 : N).
- HA **attends** Patient (M : N).
- Patient **is treated in** Ward (N : 1).
- Ward **is associated to** HA (1 : N).
- Patient **takes** Drugs (M : N) with attributes *no_of_time* and *length*.

#### ER diagram
```text
        (overtime)(rate)
              |
           [Staff]
              |
            (ISA)
            /   \
        [Doctor] [HA]-N--<associated>--1--[Ward]
           |       |                         |
           1       M                         1
      <assigned> <attends>              <treated_in>
           |       |                         |
           N       N                         N
           +----[Patient]--------------------+
                   |  (req_treatment)
                   M
                <takes>--(no_of_time, length)
                   |
                   N
                [Drugs]
```

Staff attributes are inherited by both Doctor and HA, so they are stored once in Staff.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why are overtime and rate stored in Staff rather than in Doctor and HA?
   A. Doctor and HA have no attributes
   B. Doctor and HA inherit Staff's attributes, so they are stored once
   C. Staff is a weak entity
   D. Each subclass must repeat them
   Answer: B. Specialization (ISA) lets subclasses inherit the superclass attributes. (Key point: ISA Staff)

2. What is the cardinality of 'Doctor is assigned to Patient'?
   A. M : N
   B. N : 1, many doctors to one patient
   C. 1 : 1
   D. 1 : N, one doctor to many patients
   Answer: D. As given in the solution, a doctor is assigned many patients. (Key point: Doctor-Patient)

3. Where do no_of_time and length belong?
   A. On the Ward entity
   B. On the M : N relationship 'takes' between Patient and Drugs
   C. On the Doctor entity
   D. On the 'attends' relationship
   Answer: B. They describe a patient-drug combination, so they are relationship attributes. (Key point: Takes relationship attributes)

4. What is the cardinality of 'Patient is treated in Ward'?
   A. 1 : N, one patient in many wards
   B. M : N
   C. 1 : 1
   D. N : 1, many patients in one ward
   Answer: D. Many patients are treated in the same ward. (Key point: Patient-Ward)

## Related in Database Management System

- [ER diagram: cricket tournament](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Aer-cricket-tournament) — Database Management System, chapter 2
- [ER diagram: employee, skill, machine](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Aer-employee-skill-machine) — Database Management System, chapter 2
- [ER diagram: product and components](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Aer-product-component) — Database Management System, chapter 2

## Related in other subjects

- [Rural area 22000 L/day river supply (question text cut)](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Ares-a76) — Water Supply Engineering, chapter 7
- [Purposes of DFD and ER diagram](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Adfd-er-purpose) — Software Engineering, chapter 2
