Reputation: 11
I'm trying to create a hospital RDBMS and i need to create a ternary relationship between doctor, department, and patient, the ER part of the ER diagram which they need be assigned in that way. But I couldn't create their tables in the database.
The relationships are :
Many doctor can assign many patients and patients can assign many doctor, but many of the two(doctor and patient) can assign one department.
How can I create their SQL tables ?
Upvotes: 0
Views: 647
Reputation: 1042
Department Doctor (with FK of Department) Patient (with FK of Department) DoctorPatient (With FKs of Doctor & Patient)
Upvotes: 0