In an E-R Diagram how would i model two many-to-many relationships
FACILITY
Facility_ID
Name
etc
PHYSICIAN
Physician_Id
Name
etc
PATIENT
Patient_Id
Name
etc
M:N – where a Facility can staff many Physicians and a Physician can be enmployed by many facilities
M-N – where a Patient can be treated by many Physicians and a Physicians can treat many patients’
This is a common relational design problem. To solve it, you create so called a junction table or an associative entity.
Here are some helpful explanations with examples that should help you relate to yours:
http://en.wikipedia.org/wiki/Associative_Entities
http://en.wikipedia.org/wiki/Junction_table
In your case, you would probably have:
and
You may also find that sometimes in data model optimizations and depending on the balance of the relationship some denormalize junction tables.