Help me to understand. There are two entities linked by a third, that is, a many-to-many connection, one doctor can work at several sites and several doctors can work at one site. I took out the essence of the office separately, the connection turned out 1 to many, or the office also belongs to the doctors and the connection many to many? If so, then it turns out here are two links many to many? So confused, please explain. 
- You decide what is associated with. The figure shows the connection of the entity "schedule" with other entities. It seems everything seems to be true. Entities do not communicate with third entities. For this purpose, the moogut is used, or other classes of objects may not be used. In the sql database, many-to-many are represented by join tables. In the data model, such tables are not explicitly represented at all, they are hidden in the depths of ORM. - Sergey
|
1 answer
If the entity Cabinet is an attribute of the entity Doctor, then the connection is incorrect. And if this is an attribute of the entity Schedule, then yes, it formally seems that you have two many-to-many connections.
But in fact there are none. Because the Schedule is an independent entity. While the connection of many-to-many implies a direct connection of two entities, without the essence of the "intermediary".
- Cabinet can not be an attribute. The doctor has an office assigned to him, but in each particular case he can have a reception in another. Maybe in his office now repair. In addition, they often appoint not personally to the doctor, but to the narrow specialization room. It doesn't matter who the doctor is, for he is alone and the poor patient has no choice. - Sergey
- In this scheme there should be, generally, TWO Cabinet attributes. The first is the attribute of the entity Doctor (the same "fixed"). The second is an attribute of the Reception Schedule entity. And they should use the same dictionary table storing instances of the Cabinet entity with a one-to-many relationship. - Akina
|