基础数据库设计问题-1属性三个实体
请有人能澄清一些我现在应该真正知道的事情吗?
如果我有三个实体组织、董事和公司秘书,并且每个人都有属性主要地址。
如果我正在建模概念 ERD,我应该在每个实体中分别具有属性“主地址”,还是应该建模第四个实体地址,添加主地址并使它们全部 PK > > FK 那个?
此后找到了此链接Is this a good way to model address information in a相关数据库?它几乎涵盖了我需要知道的所有内容。
Please can someone clarify something which I should really know by now?
If I have Three Entitys Organisation, Director and Company secretary and each have the attribute primary address.
If I were modelling a conceptual ERD should I have the attribute ‘primary address’ separately in each entity or should I model a fourth entity Address, add primary address and have them all PK > FK to that?
Have since found this link Is this a good way to model address information in a relational database? which pretty much covers everything I need to know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会做这样的事情,假设主要地址指的是组织位置:
表:组织
Org_Key {PK},
组织名称,
主要地址字段,
任何其他字段
表:人员
Person_Key {PK},
组织键 {FK},
职位{目录、秘书等},
任何其他领域
我认为,确实没有必要将“董事”与“秘书”分开,因为他们都是特定组织的雇员。
现在,如果您所说的主要地址是指个人地址(即个人家庭住址),那么我将向“人员”表添加其他字段。
I would do something like this, assuming primary address refers to the Organization location:
Table: Organization
Org_Key {PK},
Org_Name,
Primary Address fields,
Any other fields
Table: Personnel
Person_Key {PK},
Org_Key {FK},
Position {Directory, secretary, etc},
Any other fields
In my opinion, there is really no need to separate those who are "Directors" from those who are "secretaries" because they are both employees of a specific Organization.
Now, if by primary address you mean a personal address (i.e., an individuals home address) then I would add additional fields to the Personnel table.