Weak entity sets and Strong entity sets
Weak entity sets:
If an entity set do
not have sufficient attributes to form a primary key, then such an entity
set is termed as a weak entity set. For ex: consider the entity set payment which has the three attributes:
payment - number, payment - date and payment -amount.
Payment numbers are typically sequential numbers, starting
from 1, generated separately for each loan. Although, each payment entity is
distinct, payments for different loans may share the same payment - number.
Thus, this entity set does not have a primary key; as such, it is a weak entity
set.
In order to be meaningful, weak entity set must be associated
with another entity set, called as identifying
or owner entity set. This means that a weak entity set is said to be existence dependent on the identifying
entity set. An identifying entity set is said to own the weak entity set that it identifies.
The relationship associating the weak entity set with the
identifying entity set is called the identifying
relationship. Identifying relationship is many to one (M: 1) from the weak
entity set to the identifying entity set, and the participation of the weak
entity set in the relationship is total.
In our example, the identifying entity set for a payment is loan,
and a relationship loan-payment that associates payment entities with their corresponding
loan entities is the identifying relationship.
The discriminator
of a weak entity set is a set of attributes that allows this distinction to be made.
For ex: the discriminator of the weak entity set payment is the attribute payment-
number, for each loan, if payment number uniquely identifies one single payment
for that loan. A discriminator of a weak entity set is also called the partial key of the entity set.
The primary key of a weak entity set is formed by the primary
key of the identifying entity set, plus the weak entity set’s discriminator. In
case of the entity set Payment, its primary key (PK) is {loan- number, payment-number},
where Loan - number is the primary key of the identifying entity set, namely loan,
and payment - number distinguishes payment entities within the same loan. The
identifying relationship set should have no
descriptive attributes.
A weak entity set can participate in relationships other than
the identifying relationship. For instance, the payment entity could participate
in a relationship with the Account entity set, identifying the account from
which the payment was made. A weak entity set may participate as owner in an identifying relationship
with another weak entity set. It is also possible to have a weak entity set
with more than one identifying entity set.
In ER
diagrams, a doubly out lined box
indicates a weak entity set, and doubly outlined diamond indicates the
corresponding identifying relationship.
Fig: E-R diagram showing weak entity
set
In above fig., the weak entity set payment depends on the
strong entity set loan via the relationship set loan- payment. The above fig.
also depicts the use of double lines to indicate total participation.
The participation of the weak entity set payment in the relationship loan – payment is total, meaning that every payment must be related via loan - payment to some loan. An arrow (🠈) from loan – payment to loan indicates that each payment is for a single loan. The discriminator of a weak entity set is also underlined but with a dashed rather than a solid line.
Strong entity set:
Entity types that consist of key attributes are called strong entity sets. The strong entity set consists of parent entity type or dominant entity type. Strong entity type set can always be represented as complex (composite, multivalued) attributes.
Here, loan is an entity having a primary key called Loan_no.
Hence, loan is a strong entity.
Differences between strong entity set and weak entity set:
Strong entity set |
Weak entity set |
An entity set having a primary key is termed as strong entity set. |
An entity set is termed as weak entity
set if its existence depends on other
entities i.e. strong entities. |
It has
sufficient attributes to form a primary key. |
A weak entity set does not have sufficient attributes to form a primary key. |
Strong entity set is indicated in ER
diagrams by a single outlined
rectangle. |
A weak entity set is indicated in ER
diagrams by a doubly outlined
rectangle. |
The primary key of a strong entity set is
formed by primary key of strong entity set. |
The primary key of weak entity set is
formed by primary key of strong entity set, plus its discriminator. |
Strong entity set is not existence dependent on the identifying entity set. |
Weak
entity set is said to be existence
dependent on the identifying entity set. |
No comments:
Post a Comment