Question

I am drawing an ERD diagram for a hospital data base system scenario. In the database there are 2 types of doctors, one is a researcher and one is a practitioner. When drawing the ERD, I have created 2 different entities for them, and for the primary key I have given doctorID as the primary key for both the entities.

So my question is, is it possible to have one primary key for 2 entities?

Thank you for your time.

Was it helpful?

Solution

It sounds like what you want is inheritance. You have a base Doctor entity, with the child Researcher and Practitioner types. The primary key is on the base Doctor entity.

This is a very useful post about how you can actually model these in a database: How do you effectively model inheritance in a database?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top