Key points:
So the ER diagram as required:
ER
diagram:
ER model is to represent the strucre of data by using entities and
attributes and their reklations. ER diagram considers entities in
real world and relating with them. It is a graphical view.
Relational
diagram:
In Relational database model,the entities and relations are
represented by using tables. Each table contains records and
attribues.
ERD-Relational Schema
Now let us convert ER diagram to Relational tables:
1) Relationship between Ward and Patient: As it contains 1:N relationship,we are adding primary key of Ward as foreign keyb of Patient table.
Ward(Ward_Number,Ward_Name)
Patient(Admission_Number,Name,Number,Address,Ward_Number)
2) Relationship between Doctor and Patient: As it contains 1:N
relationship,we are adding primary key of Doctor as foreign keyb of
Patient table.
Doctor(Doctor_Id,Doctor_Name,Speciality)
Patient(Admission_Number,Name,Number,Address,Ward_Number,Doctor_Id)
3) Relationship between Nurse and Patient: As it contains N:N relationship,we are adding relationship as another table.
Nurse(Nurse_ID,Nurse_Name)
Assists(Admission_Number,Nurse_ID)
Patient(Admission_Number,Name,Number,Address,Ward_Number,Doctor_Id)
4)Relationship between Ward and Doctor :As it contains 1:N relationship,we are adding primary key of Ward as foreign key of Doctor table.
Ward(Ward_Number,Ward_Name)
Doctor(Doctor_Id,Doctor_Name,Speciality,Ward_Number)
5) Relationship between Ward and Nurse: As it contains 1:N relationship,we are adding primary key of Ward as foreign key of Nurse table.
Ward(Ward_Number,Ward_Name)
Nurse(Nurse_ID,Nurse_Name,Ward_Number)
So the final tables are:
Patient(Admission_Number,Name,Number,Address,Ward_Number,Doctor_Id)
Ward(Ward_Number,Ward_Name)
Nurse(Nurse_ID,Nurse_Name,Ward_Number)
Assists(Admission_Number,Nurse_ID)
Doctor(Doctor_Id,Doctor_Name,Speciality,Ward_Number)
Get Answers For Free
Most questions answered within 1 hours.