I have one table of orders when a user came to the store where they could buy more than one item, for example. Can I find out what are the best practices for doing this? Does each item arrange one row in the order table or mix everything into one row in the order table?
Say a customer. Buy 3 items from the store. will there be 3 rows in the order table? or 1 row in the order table with all the details and a separate order with a separator?
My designed structure is as follows:
tblOrder
OrderID (Primary Key)
UserID
TotalPrice
tblOrderItem
OrderItemID (Primary Key)
OrderID (Referencing tblOrder)
Quantity
ItemID (Referencing tblItem)
TotalPrice
Is it correct?
source
share