Search code examples
many-to-manyentityentity-relationshipdiagramerd

How to read this ER relationship?


I just had a quiz and one of the questions was to pick the correct description of the following ER diagram (with A and B instead of E1 and E2):

1

The correct answer was:

Every instance of data type A is related to many instances of data type B, and every instance of data type B is related to many instances of data type A.

My answer was:

An instance of data type A is related to many instances of data type B and an instance of data type B is related to many instances of data type A.

Isn't this absolutely the same from a linguistics standpoint?

I have researched the topic thoroughly but I cannot come to a conclusion what is the correct answer here. Is one more correct than the other or both are correct?


Solution

  • This is indeed tricky and subtle, and the quizz wording is moreover ambiguous. However there is a difference and the quizz is right.

    What you described is a normal N:M relationship with partial relationship. The correct wording would be:

    An instance of data type A can be related to many instances of data type B and an instance of data type B can be related to many instances of data type A.

    The key difference in your answer is that there could be some A and and some B that do not participate in the relationship. But this would be the correct answer if the diagram would have used simple lines with the relation.

    But the quizz diagram uses a double line. This is not graphical fancyness, but expresses total participation. This means that every A and every B must participate to the relation. In other words, there can be no A that isn’t related to at least a B, and vice-versa. This is why the correct answer is not what you expected.

    However the correct answer is ambiguously worded because participating in the relation doesn’t require to necessarily be related to many entities on the other side; one is sufficient. A better wording could therefore be:

    Every instance of data type A is related to one or more instances of data type B, and every instance of data type B is related to one or more instances of data type A.

    By the way, ERD doesn’t use “data types” but “entities”. More information on Chen’s ERD notation here.