Understanding many-to-many ternary relationship sets

database-designerdmany-to-many

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)?

Best Answer

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.