Question

Can I set a relation between an entity and a many to many relationship on ER model? If so, how do you represent it?

I read ER data model (connecting 2 relations) this but it just speaks about relational model...

In my case I have a supermarkets DB. I will speak just about the entities with this problem:
-Supermarket sells Product.
-Product is sold on Supermarket.
-A Supermarket sells (0, n) Product and a Product is sold on (0, n) Supermarket : many to many relationship. price is a relationship attribute.
-User adds a price for a Product on an specific Supermarket.

So can I add a relationship between User entity and sells relationship? How do you represent it on ER model?

If not I should set a relationship between Supermarket and Price (in this case as a weak entity: it needs Supermarket as identifier) and another relationship between Price (weak entity) and Supermarket (strong entity).

Thanks in advance.

Was it helpful?

Solution

Well, I think I have found the solution. There are two choices:
1.- Ternary relationship between User, Supermarket and Product.
2.- Something like in the example in the picture attached:enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top