`

【转】Identifying and Non-Identifying Relationships

阅读更多

      这是一篇关于关系数据库中 Identifying 和 Non-Identifying Relationships的解释,下面转贴以做参考.

      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.

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.



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics