zoukankan      html  css  js  c++  java
  • non-identifying and identifying

    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.

    Let’s take a real time example of a book storing system. In the system, a book belongs to an owner, and an owner can own multiple books. But the book can also exist without the owner and it can change the owner. Thus the relationship between a book and an owner is a non-identifying relationship.

    Now suppose one intends to keep a record of chapters included in a book. We know that chapters will only exist when a book exists. Thus the relationship between a book and its chapters is an identifying relationship.

    In database terms, relationships between two entities may be classified as being either identifying or non-identifying. Identifying relationships exist when the primary key of the parent entity is included in the primary key of the child entity. On the other hand, a non-identifying relationship exists when the primary key of the parent entity is included in the child entity but not as part of the child entity’s primary key. In addition, non-identifying relationships may be further classified as being either mandatory or optional. A “mandatory” non-identifying relationship exists when the value in the child table cannot be null. On the other hand, an “optional” non-identifying relationship exists when the value in the child table can be null.

    原文:https://www.datanamic.com/support/relationshiptypes.html

    https://www.vertabelo.com/blog/documentation/defining-identifying-and-non-identifying-relationships-in-vertabelo

  • 相关阅读:
    jquery键盘事件
    如何将奇艺、优酷等平台的视频嵌入到项目中
    ubuntu 10.04 常用 设置
    博客风格收集
    多张图片上传预览
    动态计算输入框字符个数
    Ubuntu Linux下设置IP的配置命令
    js事件浏览器兼容
    开源软件下载站
    PHPstrom的一个小技巧
  • 原文地址:https://www.cnblogs.com/anqiang1995/p/11162823.html
Copyright © 2011-2022 走看看