OCR H446 Style · 4 marks
A hospital database stores information about Doctors and Patients. A doctor can treat many patients, and a patient can be treated by many doctors. Describe how you would model this relationship in a relational database.
[4 marks]
1
This is a many-to-many (M:M) relationship — one doctor treats many patients, and one patient sees many doctors.
1
A M:M relationship cannot be directly implemented in a relational database; it must be resolved with a link table.
1
Create a link table, e.g. Treatment(DoctorID, PatientID, Date), with DoctorID as a foreign key referencing Doctor, and PatientID as a foreign key referencing Patient.
1
This creates two 1:M relationships: Doctor 1:M Treatment and Patient 1:M Treatment. The composite primary key (DoctorID, PatientID, Date) uniquely identifies each treatment record.