且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Mysql数据库设计结构

更新时间:2023-02-02 22:28:50

似乎你想保留每个订单的原价。我要做的是使用选项1,然后在表中创建另一个列,其中包含标识顺序中每个项目的字符串。

It seems like you want to retain the original price of each item ordered. What I'd do is go with option 1, then create another column in your table that holds a string that identifies each item in the order.

例如,如果我出售水果,香蕉可以有 iZ 作为唯一键。一个苹果可以有 6U 作为唯一键。当用户下订单时,这些唯一键将插入到新列中。因此,当您看到此列的数据是 iZ6U 时,您会知道用户订购了一个苹果和一个香蕉。

For example, if I were selling fruit, a banana could have iZ as a unique key. And an apple could have 6U as a unique key. When a user places an order, these unique keys would be inserted into your new column. So when you see this column's data is iZ6U you'd know that the user ordered an apple and a banana.