[英]ER Diagram, Physical Data Model Relations
I am trying to create a very simple database Supermarket management system.我正在尝试创建一个非常简单的数据库超市管理系统。 And it seems that I am having a problem with how relations work between entities, I am using PowerDesigner to create the ERD and then generate everything from it(LDM, PDM, OOM).
似乎我对实体之间的关系如何工作有疑问,我正在使用 PowerDesigner 创建 ERD,然后从中生成所有内容(LDM、PDM、OOM)。 Is this a bad idea?.
这是一个坏主意吗?。
Now for my main problem It's between these 3 tables:现在我的主要问题是在这三个表之间:
The way I did it is:我这样做的方式是:
The customer gather the products he wants to buy and present it to the employee, then the employee gets the order for the customer from the machine, so:客户收集他想要购买的产品并将其展示给员工,然后员工从机器中获取客户的订单,因此:
I am sticking to the Relational Database context, that you have tagged.我坚持使用您已标记的关系数据库上下文。
Data Modelling is an iterative process.
数据建模是一个迭代过程。 There is a lot more definition that is needed, before the data model can be complete.
在完成数据 model 之前,还需要更多定义。 Rather than answering the specifics that you request, which would be limited to one iteration;
而不是回答您要求的细节,这将仅限于一次迭代; one increment, allow me to provide something more complete, several iterations progressed.
一个增量,请允许我提供更完整的东西,进行了几次迭代。
If it is useful, please discuss this data model, and progress it to fulfil all your requirements.如果有用,请讨论此数据 model,并进行改进以满足您的所有要求。
Of course it is too small as an inline graphic.当然,它作为内联图形太小了。 As a PDF Supermarket Data Model .
作为 PDF 超市资料 Model 。
The Standard for Relational Data Modelling since 1983 is IDEF1X.自 1983 年以来的关系数据建模标准是 IDEF1X。 For those unfamiliar with the Standard, refer to the short IDEF1X Introduction .
对于不熟悉该标准的人,请参阅简短的IDEF1X 简介。
I am using PowerDesigner to create the ERD and then generate everything from it (LDM, PDM, OOM).
我正在使用 PowerDesigner 创建 ERD,然后从中生成所有内容(LDM、PDM、OOM)。 Is this a bad idea?.
这是一个坏主意吗?。
Now for my main problem It's between these 3 tables:
现在我的主要问题是在这三个表之间:
I have solved that issue.我已经解决了这个问题。 And exposed others.
并暴露了其他人。
each customer can request_order from one or more Employee and each Employee can get_order to one or more Customer
每个客户可以从一个或多个员工请求订单,每个员工可以向一个或多个客户获取订单
each Employee can get_order to one or more Customer每个 Employee 可以 get_order 给一个或多个 Customer
Yes, but that is the overall result.是的,但这是总体结果。 In each shopping or presentation instance:
在每个购物或演示实例中:
The problem is if I want to know the customer related to that specific order......I can't.
问题是如果我想知道与该特定订单相关的客户......我不能。 How do I fix this?
我该如何解决?
Solved: Each Order is Identified by (CustomerId, DateTime)
, ie.已解决:
Each Order is Identified by (CustomerId, DateTime)
,即。 the Customer
who created the Order
.创建
Order
的Customer
。
RecordIds
are anti-Relational. RecordIds
是反关系的。 They are certainly not needed in a Relational database.RecordId
based file ever can.RecordId
的文件。 Please feel free to comment or ask specific questions.请随时发表评论或提出具体问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.