0% found this document useful (0 votes)
5 views4 pages

Hospital System (ERD)

The document outlines the entities and attributes in a healthcare database, including Doctors, Doctor Family, Department, Employee, Patient, and Drug, each with specific attributes. It describes the relationships between these entities, such as one-to-many and ternary relationships, detailing participation levels. Additionally, it provides a mapping for database tables corresponding to each entity, specifying primary and foreign keys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

Hospital System (ERD)

The document outlines the entities and attributes in a healthcare database, including Doctors, Doctor Family, Department, Employee, Patient, and Drug, each with specific attributes. It describes the relationships between these entities, such as one-to-many and ternary relationships, detailing participation levels. Additionally, it provides a mapping for database tables corresponding to each entity, specifying primary and foreign keys.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Entities and attributes:

1. Doctor (Strong entity)


Attributes:
Doc-id: Simple attribute (Primary key)
Name: Composite attribute (consists of First and Last)
(Domain, Age, and Email) are Simple attributes
2. Doctor Family (weak entity)
Attributes:
SSN: Simple attribute (Partial key).
Name: Composite attribute.
(Relation and Age) are Simple attributes.
3. Department (Strong entity)
Attributes:
ID-dep: Simple attribute (primary key).
(Name and Head of Dep.) are Simple attributes.

4. Employee (Strong entity)

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.

5. Patient (Strong entity)

Attributes:
ID-Patient: Simple attribute (Primary key).
Phone: multivalued or complex.
(Gender and history) are simple attributes.

6. Drug (Strong entity)

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.

Department and doctor relationship


Type: Binary relationship.
Cardinality: One to Many, as one department may have many doctors, but the doctor only
works for one department.
Participation: it's partial participation for the department but a total for the doctor.

Department and employee relationship


Type: Binary relationship.
Cardinality: One to Many, as one department may have many employees, but the
employee only works for one department.
Participation: it's partial participation for the department but a total for the employee.

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).

You might also like