Hello Lili
Hello Lili

Reputation: 1587

Why are these associations many-to-many?

I have the entities EMPLOYEE, ADDRESS and STUDIES, associated as in the picture below. An employee can have more than one address, and could have studied at more than one colleges.

Why are the relationships below (Has_address and Graduated) more-to-more? Shouldn't they be one-to-more? (Because, for example, an address belongs to just ONE employee)?

enter image description here

Upvotes: 0

Views: 25

Answers (1)

Aganju
Aganju

Reputation: 6405

Other employees could have lived at that same address (at the same or different times; married couples often share an address).

Also, more than one employee might have gone to the same college, and you don't necessarily want to copy the college's data for each employee that went there.

It depends on how you want your structure - you can say there is a single object 'address', and it is really 'a property' of the employee, so it would be 1:n (only allowing for moves of the employee). Or you argue that addresses are objects of their own (a location exists independent of your employees), and 'address' is a relation between an employee and a location; then it would be n:m.

The core point is if you want to handle locations as separate objects or not. Neither is right or wrong, it is a design decision that you have to make about the limits of your model.

Upvotes: 1

Related Questions