Sunday, March 3, 2013

Weak Entity and Strong Entities in DBMS

An entity set that does not possess sufficient attributes to form a primary key is called a weak entity set. One that does have a primary key is called a strong entity set.

 For example,
The entity set transaction has attributes transaction-number, date and amount.
Different transactions on different accounts could share the same number.
These are not sufficient to form a primary key (uniquely identify a transaction).

Thus transaction is a weak entity set.
For a weak entity set to be meaningful, it must be part of a one-to-many relationship set. This relationship set should have no descriptive attributes.

The idea of strong and weak entity sets is related to the existence dependencies seen earlier in the class.

Member of a strong entity set is a dominant entity (Parent Entity)
 Member of a weak entity set is a subordinate entity (Child Entity)
A weak entity set does not have a primary key, but we need a means of distinguishing among the entities.

The discriminator of a weak entity set is a set of attributes that allows this distinction to be made.

The primary key of a weak entity set is formed by taking the primary key of the strong entity set on which its existence depends , plus its discriminator.

To illustrate:

transaction is a weak entity. It is existence-dependent on account.
The primary key of account is account-number.
transaction-number distinguishes transaction entities within the same account (and is thus the discriminator).
So the primary key for transaction would be (account-number, transaction-number).
Just Remember: The primary key of a weak entity is found by taking the primary key of the strong entity on which it is existence-dependent, plus the discriminator of the weak entity set

No comments:

Post a Comment