我無法理解部分鍵/弱實體與外鍵之間的差異。我覺得自己不能理解這些東西。外鍵與部分鍵及其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