数据建模验证
寻求有关对以下通用需求进行建模的最佳方法的建议。由于这些只是通用的,因此模型中仅包含基本实体/属性。
目的是捕获并列出可能拥有或不拥有特许经营权的企业的网站。
- 企业可能有零个、一个或多个网站
- 企业的特许经营权(包含ExternalBusinessId 的原因)可能会或可能不会与企业本身或其他特许经营权共享相同的网站
在我尝试满足这些要求时,我从 PK 中删除了ExternalBusinessId网站。不确定满足这些要求是否那么简单,但看起来仍然会留下很多重复的内容。
我可能需要采取的另一种方法是将特许经营权移至他们自己的表中,这可以使这个问题更容易解决,但使我的模型的其余部分变得复杂(此处未显示)。如果将特许经营权放在自己的表中是正确的方法,我宁愿走这条路,并完成其余的练习,使其适合我的完整模型。在我当前的模型中,处理没有特许经营权的业务的方式是默认的ExternalBusinessId 001。
有什么想法吗?
谢谢
Looking for advice on the best way to model the following generic requirements. Since these are just generic only basic entities/attributes are included in the model.
The purpose is to capture and list websites for businesses that may or may not have franchises.
- A business may have zero, one, or many websites
- Franchises (reason for including ExternalBusinessId) of the business may or may not share the same websites as the Business itself or other franchises
In my attempt to fulfill these requirements I removed ExternalBusinessId from the PK of Website. Not sure if it is that simple to meet these requirements, but it looks like it would still leave a lot of dups.
Another approach that I may need to take is to move the franchises to their own table which could make this problem easier to solve but complicate the rest of my model (not shown here). If having Franchises in their own table is the right approach I would rather go that route and go through the rest of the exercise of having that fit into my complete model. In my current model the way to handle businesses without franchises they are given a default ExternalBusinessId of 001.
Any thoughts?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
网站。
如果我理解正确的话,你似乎是这样想的。
表意味着将它们从
表“业务”。
特许经营是企业。就像其他所有业务一样,将它们存储在“业务”表中。将特许经营权与其特许经营商之间的关系存储在另一个表中。
与特许经营业务相关的信息应引用表“业务”中的关键字。此类信息可能包括其邮寄地址和电话号码。
仅与特许经营权相关的信息应引用特许经营表中的关键字。此类信息可能包括特许经营许可证号和特许经营终止日期。
websites.
If I understand you correctly, you seem to think something like this.
table implies eliminating them from
the table "business".
Franchises are businesses. Store them in the table "business", just like every other business. Store the relationship between a franchise and its franchiser in another table.
Information related to the franchise as a business should reference a key in the table "business". Such information might include its mailing address and phone numbers.
Information related only to the franchise as a franchise should reference a key in the table of franchises. Such information might include the franchise license number and franchise termination date.