0

there is 3 entity namely customer, vehicle and workshop. customer buys vehicle and customer may repair that vehicle in a workshop. Figure here in the ERD customer buys one or more vehicle and customer repairs vehicle in the workshop i ma confused about the ternary relationship and about the cardinal there, is this correct? what about cardinal in the ternary relation here?

Nameless
  • 503
  • 3
  • 21

1 Answers1

0

The cardinality of ternary and higher relationships are always tricky. My approach is to think of the cardinality of each role as compared to the combination of all the other roles.

For example, the cardinality of Workshop can be compared to the combination of Customer and Vehicle. For each unique (Customer, Vehicle) pair, how many times can they visit a Workshop? I would say many times.

For each unique (Customer, Workshop) combination, how many Vehicles can be involved? Again, I would say many.

For each unique (Workshop, Vehicle) visit, how many Customers can be involved? If Vehicle determines Customer (via the binary relationship buys), only one customer can be involved, but if you want to allow customers to be able to repair vehicles they didn't buy, then it's many.

Note that if Vehicle determines Customer, there's no need to include Customer in the repairs relationship.

reaanb
  • 9,806
  • 2
  • 23
  • 37