Question

I am having a massive confusion as Im trying to develop an ERD Diagram and am confused by this statement. I am trying to relate two entities. they are "order" and "products". So im confused about the cardinality of these two. will it be 1 order will have many products or will it be 1 product can be ordered many times. BTW my entities for my ERD are. Customers, Products, Sales, Orders, Staff. Thank you very much.

Was it helpful?

Solution

I would suggest go for many to many. You'll need another auxiliary entity (data from whose table should not be exposed to the user) such as OrderProductMap.

It will let you maintain orders, and a list of products. In case of one to many from Order to Product, each order will have to create a separate product instance, which is not a natural thing to do. The opposite is not sound either. An order should NOT be limited to a single product.

OTHER TIPS

Not a lot of detail to work with here, but I would say almost certainly that it's "1 order will have many products."

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