ARCS-数据建模
我正在阅读 this 有关数据建模的弧的文章。
这个示例说:
弧是代表相互排斥关系的一种方式 ERD。 该弧代表独家或关系 - 每个关系 会员资格必须由一家公司持有,或者必须由一家公司持有 客户,但不是两者。
我的疑问是:如何在数据库中进行物理实现?我是否需要创建我的触发器或其他东西来验证一个或另一个,但并非同时验证?还是在这种情况下是否有一些限制?
I am reading this post about arcs from data modeling.
This example says:
Arcs are a way to represent mutually exclusive relationships in the
ERD.
This arc represents the exclusive OR relationship – each
MEMBERSHIP must be held by one COMPANY or must be held by one
CUSTOMER, but not both.
My doubt is: how do I implement this physically in database? Do I need to create I trigger or something else to validate one or other, but not both at the same time? or if is there some constraint to use in this case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在以下操作:
创建表:会员tatepe
将两个列添加到会员表
您需要确保会员类型,会员组合的组合是独特的,以便您可以确定会员资格是由客户还是公司持有的。
You can do below things:
Create Table : MembershipType
Add Two columns to Membership table
You need to make sure that MembershipTypeId, MemberId combination is unique, so that you can identify whether the membership is being held by Customer or Company.