-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRelationships
More file actions
48 lines (22 loc) · 1.05 KB
/
Copy pathRelationships
File metadata and controls
48 lines (22 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Relationships between tables:
1. Patient ↔ Appointment
1-to-Many: One patient can have one or multiple appointments.
2. Doctor ↔ Appointment
0-to-Many: One doctor can have zero or many appointments.
3. Appointment ↔ Payments
1-to-1 (Optional): An appointment may have one payment record.
4. Patient ↔ Diagnosis
(Associative Table: Diagnosis_Patient)
Many-to-Many: Patients can have multiple diagnoses; a diagnosis can apply to multiple patients.
5. Patient ↔ Medicine
(Associative Table: Patient_Medicine)
Many-to-Many: Each patient can be prescribed many medicines, and each medicine can be prescribed to many patients.
6. Doctor ↔ Hospital
(Associative Table: Hospital_Doctor)
Many-to-Many: Doctors may work at multiple hospitals.
7. Doctor ↔ Shift
(Associative Table: Doctors_Shifts)
Many-to-Many: Doctors can have multiple shifts; shifts can apply to multiple doctors.
8. Hospital ↔ Department
(Associative Table: Department_Hospital)
Many-to-Many: Hospitals house multiple departments; departments exist across multiple hospitals.