订单,客户和产品之间的关系? [英] Relationship between orders, customers and products?

查看:983
本文介绍了订单,客户和产品之间的关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个电子商务数据库,但我不了解订单,产品和客户之间的关系。
有很多数据库示例,但是它们太复杂了。有没有关于可能的表和关系的简单解释或示例。

I am trying to construct an e-commerce database but I don't understand relationship between orders, products and customers. There are lots of database examples but they are too complex. Is there a simpler explanation or an example about possible tables and relationships.

谢谢。

推荐答案

这是最简单的形式,如果客户可以拥有多个订单并且订单可以用于多个产品:

This is the simplest form if customers can have more than one order and orders can be for more than one product:

ORDER 表具有有关订单日期和状态的信息。

The ORDER table has information about the date and status of the order.

ORDER ITEM 表具有信息关于订购的产品的数量。

The ORDER ITEM table has information about the quantity of the product ordered.

唯一比这更简单的方法是,如果您对业务规则有限制,说我不跟踪我的客户从一个订单转到下一个订单或每个订单仅用于一项。如果确实有这些规则(不现实地简单化?),则可以减少模型中表的数量。

The only way to get simpler than this would be if you have a business rule restriction that says "I don't keep track of my customers from one order to the next" or "each order is for exactly one item". If you did have these (unrealistically simplistic?) rules, then you could reduce the number of tables in your model.

请注意,这个非常简单的模型将获得更多信息很快就会变得复杂,您希望它变得更加灵活和现实。例如,增加定价,付款方式,付款或库存都会增加很多复杂性。

Note that this very simple model starts to get much more complicated very quickly the more flexible and realistic you want it to be. Adding in pricing, payment methods, payments, or inventory, for example, would all add a lot of complexity.

这篇关于订单,客户和产品之间的关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆