Hospital System (ERD)
Hospital System (ERD)
Attributes:
ID-Employee: Simple attribute (Primary key)
(Position and Salary) are Simple attributes
Phone: multivalued attribute (as an employee may have multiple phone numbers) can
also be complex if it includes the country’s code.
Attributes:
ID-Patient: Simple attribute (Primary key).
Phone: multivalued or complex.
(Gender and history) are simple attributes.
Attributes:
Drug-id: Simple attribute (Identifier)
(Name and Dosage) Simple attributes.
Side effects: Multivalued attribute (as a drug can have multiple side effects)
Relationships
Doctor and Doctor family relationship
Type: Binary relationship.
Cardinality: One to Many, as one doctor may have many members.
Participation: it's partial participation for the doctor but a total for the doctor's family.
Treatment
Type: Ternary relationship involving Doctor, Patient, and Drugs.
Cardinality: Many to many, as a doctor can treat multiple patients with multiple drugs.
Participation: partial for the 3 entities as each of them can exist without being associated
with the other. (this may differ from one hospital to another)
Mapping:
1. Doctors Table: (Doc-id (primary key), first name, last name, domain, Age, email,
ID-dep (Foreign key)).
2. Doctor Family: (SSN (primary key), first name, last name, Relation, Age, Doc-id
(Foreign key)).
3. Department Table: (ID-dep. (primary key), Name, Location, Head of department, ID-
Employee of the head (Foreign key)).
4. Employees Table: (ID-Employee (primary key), position, salary, phone, ID-dep.
(Foreign key)).
5. Patient Table: (ID-patient (primary key), phone, gender, history).
6. Drug Table: (Drug-id (primary key), Name, Dosage, Side effects).
7. Treatment Table: (Doc-id, ID-patient, Drug-id).