Question

now i'm developing an e-commerce system. I've table named cart which store the cart_id, product & price.

Now, I want to proceed with the checkout. When the customer click checkout button, all the items in cart will become 1 order. But I have no ides how the order table will look like? because in 1 order may got many cart_id.

anyone got idea for this table? from cart to checkout.

Was it helpful?

Solution

By what I have understand,

  • you can have several product in one cart
  • you can have several cart in one order

Am I right?

If this is the case, the best way I think would be to create 3 tables, with one-to-many relationship between the tables:

enter image description here

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