What is the difference between Associative Entity and Intermediate Table of Relationships N for N?

2

What is the difference between the Associative Entity and the Intermediate Relationship Table N for N ? Is there any noticeable difference in the translation of the ER template for the relational model ?

In the ER model associative entities are represented by a rectangle around the relationship. And the relationships N to N do not.

Relationship N to N

AssociativeEntity

    
asked by anonymous 07.01.2017 / 19:51

2 answers

2

In the associative entity, also called aggregation, imagine that you want to know if the medicine that the doctor prescribed for the patient in any query needs a prescription (a flag in the drug entity). Relating to the entity Medication as the Medical or Patient entity does not make sense, since the issuance of revenue refers to the consultation performed. Therefore, the Medication entity must relate to Consultation. Intermediate tables generally contain only two columns that act as a link between the two main tables, as is the case between Engineer and Project.

    
11.01.2017 / 11:57
1
The relationship table N for N is the table generated in the conceptual-logical mapping of cardinalities N to N. Every N: N relationship generates a table in the mapping.

The Associative Entity is when the relationship with cardinality N: N between two entities needs to relate to a third entity. In such cases, such a relationship would need to be connected to some graphical representation (or to an entity or to a relationship). If it is in entities, the links are lost and if it is in the relationship, the modeling would be wrong because it is not possible for two relationships to be connected to each other. For this, the rectangle is made around the relationship. Let's look at an example:

If we try to link the DISCIPLINE entity to the STUDENT entity, we would lose the information of which course it is part of. If we connect in the COURSE, we would lose the information of which student did the discipline. If we connect in the direct relationship, we would have a modeling error. For this, an associative entity is used. In conceptual-logical mapping, the associative entity is a table as in relation to cardinality N: N, but the primary key of it can go to another table as a foreign key.

    
21.01.2018 / 01:16