What should be the relationshipbetween Order entity and order Item entity?

0
I am creating Restaurant order placing app. I have 3 entites cutomer, order and order item.  WHat should be the relationship between Order and order_item entity? Is it one to many from Order to order item or many to many? Please explain me with the details along with your answer
asked
2 answers
1

It should be many to many, 

as 1 product say “Dell Laptop” could be in the order created by harsh as well other users.

at the same time, 1 order can have many items.

 

Hope i got the context :)

answered
1

As Ganesh said, it should be many to many.

An order could contain:

1x Biryani

1x Dosa

 

but Dosa could be ordered by each customer so it could be in each order.

so 1 order could have multiple order_item and 1 order_item could belong to multiple orders.

I hope it clears your doubt.

answered