数据库设计 - ERD.建模问题 [英] Database design - ERD. Modeling Question

查看:28
本文介绍了数据库设计 - ERD.建模问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人能够快速建议我建模 ERD 的最佳方法(我使用的是 IDEF1X 和 ERWin,而不是 Chen 表示法),尽管这并不重要.

Hopefully someone may be able to quickly advise the best way for me to model my ERD (I'm using IDEF1X & ERWin not Chen Notation) although it doesn't really matter.

基本上我有三个实体

  1. 组织
  2. 受托人

业务规则规定受托人可以是个人或组织.

Business rules state that a Trustee can be either a person or organisation.

我的问题是,与 Trustee 有两个主要的外键关系是否正确.一个来自组织 > 受托人,第二个来自个人 > 受托人.受托人的 FK 字段之一将始终为 NULL,具体取决于受托人是个人还是组织.

My question is, would it be correct to have two primary, foreign key relationships to Trustee. One from Organisation > Trustee and the second from Person > Trustee. Where one of the FK fields of Trustee will always be NULL depending on if the Trustee is a person or organisation.

或者最好在个人和组织(person_organisation)之间建立某种关联表,并从 person_Organisation > Trustee 创建一个 PK、FK 关系.

Or would it be better to have some sort of associative table between person and organisation (person_organisation) and create a PK, FK relationship from person_Organisation > Trustee.

第二个选项似乎更好,因为可能还有其他实体也需要链接到组织和个人.

The second option seems better as there might be other entities that also need to link to both Organisation and person.

希望这是有道理的.

非常感谢提前

推荐答案

编辑

嗯,这也应该有效:

这篇关于数据库设计 - ERD.建模问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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