我无法理解部分键/弱实体与外键之间的差异。我觉得自己不能理解这些东西。外键与部分键及其E-R表示
据我了解:
Weak Entity: An entity that is dependent on another entity.
Partial Key: Specifies a key that that is only partially unique. Used for weak entities.
vs
Foreign Key: A key that is used to establish and enforce a relation between data in different tables.
这些似乎并不像他们一样的东西,但我无法区分它们的用途。
取[很]简单的例子:
We have employees specified by an empid. We also have children specified by name. A
child is uniquely specified by name when the parent (employee) is known.
会子实体在弱的身份,其中部分关键是名字(部分是唯一的)?或者我应该使用外键,因为我试图建立并强制员工和孩子之间的关系?我觉得我可以证明两者,但我也觉得我在这里错过了一些东西。任何见解都会受到赞赏,我对这些愚蠢的问题表示歉意。
upvote给出了一个很棒的答案,但是应该使用什么来代替这些30年前的DBMS书? – piechuckerr 2016-11-26 05:19:06