数据库设计存储交易
对于一个项目,我需要创建一个允许销售物品的系统,基本上是一个 EPOS 系统。我基本上可以使用它,但我想不出存储交易的好方法。
由于交易会有一个或多个项目,我需要知道这些项目是什么,如何将其存储在交易表中?我可以在表中的某个字段中使用 CSV 来存储多个产品 ID 吗?
transactionID
noItems
itemID <- Store more than one?
cost
有什么建议吗?
谢谢
For a project I am required to create a system which allows sales of items, basically an EPOS system. I have it mostly working but I cannot think of a good way in which to store transactions.
As a transactions would have one or more items, and I need to know what the items are how would I store this in the transactions table? Can I have CSV within a field in the table to store more than one product ID?
transactionID
noItems
itemID <- Store more than one?
cost
Any suggestions?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样的操作:
不要在单个字段中存储多个值。这将使您的数据库世界变成一个活生生的地狱。
Try something like this:
Do NOT store multiple values in a single field. This will make your database world a living hell.