문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top