1

I am new to entity-relationship diagrams. I'm a bit confused when it comes to interpreting ternary relationship sets such as this:

enter image description here

Does this signify that every relationship instance of Party will have one fighter, one mage, and one healer? If we were simply dealing with binary relationship sets without key or total constraints, every instance of the relationship would be linked to an entity from each entity set.

But in the case above, isn't it possible to not have one instance from a particular entity set? E.g. if the Party instance only had one fighter and one healer (and no mage)?

  • Where does that "exactly one" come from? – ypercubeᵀᴹ Sep 13 at 9:27
  • By that, I meant that in any instance of Party, all 3 - Fighter, Mage, and Healer must be present. Update: I have removed the word "exactly" to make it clearer. – Yash Chowdhary Sep 13 at 9:33
0

In a diagram that included that, I would call that a simple foreign key constraint. It is likely this diagram is first draft\ over-simplification of how player classes are related to parties.

If I was pushed for a stronger answer, I would have it as a many-to-one (multiple of each class can be in one party) This means that a party can have one or multiple of any class of person, but each person can only be part of one party.

The confusion for this really comes from the fact that a class is not an object in itself, it is a characteristic of a person. If you think of the class as a characteristic of a person, now you have three people in the party. The logic behind calling the party complete would be to check if, of the people in it, there is at least one of each that has the characteristic of mage, fighter, and healer. To go one step further in this, a person's party is also a characteristic of theirs. This would allow multiple people to be assigned a party, but each person can only be assigned ONE party.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.