Identifying and Non-Identifying Relationships (標識和非標識關係)

An identifying relationship means that the child table cannot be uniquely identified without the parent. For example, you have this situation in the intersection table used to resolve a many-to-many relationship where the intersecting table's Primary Key is a composite of the left and right (parents) table's Primary Keys.

標識關係中,子表種的記錄不能脫離父表獨立存在。

Example... 
Account (AccountID, AccountNum, AccountTypeID) 
PersonAccount (AccountID, PersonID, Balance) 
Person(PersonID, Name)

The Account to PersonAccount relationship and the Person to PersonAccount relationship are identifying because the child row (PersonAccount) cannot exist without having been defined in the parent (Account or Person). In other words: there is no personaccount when there is no Person or when there is no Account.

Account實體和PersonAccount實體,以及Person實體和PersonAccount實體之間就是標識關係,因爲如果父表中沒有相應記錄,子表(PersonAccount)中相應記錄就不可以存在。簡而言之,不可能存在沒有Person或者沒有Account的PersonAccount記錄。通俗一點就是,沒有父親就不會有他的孩子。

A non-identifying relationship is one where the child can be identified independently of the parent ( Account - AccountType)

非標識關係中,子表中的記錄可以獨立存在,而不依賴於父表。

Example... 
Account( AccountID, AccountNum, AccountTypeID ) 
AccountType( AccountTypeID, Code, Name, Description )

The relationship between Account and AccountType is non-identifying because each AccountType can be identified without having to exist in the parent table.

You can define the relationship type (identifying/non identifying) in the DeZign for Databases in the relationship dialog. Double click on the relationship line in the diagram window to display the relationship dialog.

上例中,Account和AccountType就是非標識關係,即使沒有Account記錄,也可以有AccountType記錄,通俗一點就是,沒有你照樣有男人和女人。

發佈了39 篇原創文章 · 獲贊 6 · 訪問量 23萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章