Pergunta

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.

Foi útil?

Solução

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.

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top