문제

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.

도움이 되었습니까?

해결책

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

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