Search code examples
entity-relationshiperd

Is the quaternary relationship in this er diagram correct?


In an exercise I have found the following ER diagram but it does not make sense to me:

diagram

As indicated in the diagram, I understand that: It is possible in 1 transaction of 1 copy of a book that is in 1 library can be made to N customers at a time. It is possible to make 1 transaction to 1 customer of 1 copy of a book that is in 0 or N libraries. If I am misinterpreting the diagram, what would be the correct interpretation?

For me the correct diagram would look like this (changes are in red):

modified diagram


Solution

  • Peter Chen's foundational article on ERD does define a relationship as a mapping between related entities. He gives examples of how to read cardinalities of binary relationships, he mentions the possibility of relationships with more than two participating entities, but he does not explain how to read the cardinalities in this case.

    The following:

    +----+    1            N   +----+
    | E1 |--------< R >--------| E2 |
    +----+                     +----+
    

    means that a given E1 can be related to N E2, and that a given E2 can be related to 1 E1.

    Extrapolating this rule to more than two entities, taking your concrete example in the first diagram would mean that:

    • For a given Transaction, Book unit and Library, there can be several customers. This is a rather strange situation, as usually one transaction is performed by one customer.
    • For a given Transaction, Customer and Book unit, there can be several Libraries. Again, this is rather strange, as we'd expect to have only one library alone if we fix the library.

    So indeed, your analysis is correct and your corrected diagram is the way to go.