What's the difference between identifying and non-identifying relationships?

前端 未结 15 1925
迷失自我
迷失自我 2020-11-22 12:02

I haven\'t been able to fully grasp the differences. Can you describe both concepts and use real world examples?

15条回答
  •  甜味超标
    2020-11-22 12:04

    A complement to Daniel Dinnyes' answer:

    On a non-identifying relationship, you can't have the same Primary Key column (let's say, "ID") twice with the same value.

    However, with an identifyinig relationship, you can have the same value show up twice for the "ID" column, as long as it has a different "otherColumn_ID" Foreign Key value, because the primary key is the combination of both columns.

    Note that it doesn't matter if the FK is "non-null" or not! ;-)

提交回复
热议问题