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 "non-mandatory". A mandatory non-identifying relationship exists when the value in the child table cannot be null. On the other hand, a non-mandatory non-identifying relationship exists when the value in the child table can be null.
Here's a simple example of an identifying relationship:
Parent
------
ID (PK)
Name
Child
-----
ID (PK)
ParentID (PK, FK to Parent.ID) -- notice PK
Name
Here's a corresponding non-identifying relationship:
Parent
------
ID (PK)
Name
Child
-----
ID (PK)
ParentID (FK to Parent.ID) -- notice no PK
Name
Existence Dependency (Strong vs. Weak Entity). ?
•The MOVIE and MOVIE_COPY example also is a case of existence dependency.
•A Strong Entity is one that exists on its own, independent of other entities.
•A Weak Entity is one whose existence depends on another entity. This means an occurrence of one entity cannot exist unless there is an occurrence of a related entity.
•This modeling situation usually occurs for binary 1:N relationships where the cardinality is mandatory-one for the weak entity.
•The Strong Entity is usually referred to as the Owner or Parent entity, while the Weak Entity is referred to as the Dependent or Child entity.
•Weak entities often do not have a natural identifier (candidate key).
•The primary key of the owner entity is used as part of the primary key of the dependent child entity.
•Note the primary key of the MOVIE_COPY entity is a composite key consisting of the attributes MovieNumber and CopyNumber.
•This situation is also called an identifying relationship. Benefits include:
o1. Data integrity of the existence dependent entity are enforced.
o2. Ease of access for related dependent entities via part of the composite key.
Friday, 8 January 2010
What is the difference between Identifying and Non Identifying relationships ?
Labels:
Data Modeling,
Database Design,
Erwin,
Logical Data Model,
Relationships
Subscribe to:
Post Comments (Atom)
Thanks for your explanation about identifying and non-identifying relationships. It was very nice.
ReplyDeleteAs you said, the clear way of distinguishing these relationships is to find whether the primary attribute of parent entity is included as a (or part of) primary attribute of child entity or not.
So, i can say that
In identifying relationships, the primary attribute of parent entity that is present in child entity can NEVER take NULL values as it is part of primary attribute of child entity.
In Non identifying relationships, the primary attribute of parent entity that is present in child entity can or cannot take NULL values as it is NOT part of primary attribute of child entity.
During the modeling phase, while deciding to choose identifying or non identifying relationship, the above point plays a crucial role.
Let me know if something else is in your mind. Thank you!
http://metallicatony.blogspot.com/2009/09/datamodeling-presentation.html
Good example, thanks
ReplyDeletecasino, poker room, blackjack, bingo
ReplyDeletecasino, poker room, titanium ring blackjack, bingo https://vannienailor4166blog.blogspot.com/ room, blackjack, bingo room, poker room, https://febcasino.com/review/merit-casino/ poker room, poker room, poker filmfileeurope.com room, poker room, poker https://septcasino.com/review/merit-casino/ room,