Previous Topic: Establishing Primary KeysNext Topic: Identifying the Attributes for Each Relationship Type


Identifying Weak Entities

What is a weak entity?

You may find that some entities in your database are identified only by their relationship with another entity. Such entities are called weak entities. Typically, a weak entity has a primary key that contains only one foreign key.

The entity DEPENDENT, for example, is a weak entity because it uses the primary key of the EMPLOYEE entity as part of its own primary key. Whenever an employee leaves the corporation, all information about that employee as well as any information about dependents must be erased from the database.

The attribute NAME is the only candidate for a primary key in the DEPENDENT entity, but NAME does not uniquely identify each occurrence of the DEPENDENT entity. Therefore, the primary key of the DEPENDENT entity must be a concatenation of the NAME attribute and the EMP ID attribute of the EMPLOYEE entity. This concatenated key provides the link between employees and their associated dependents.

Indicating a weak entity

You identify a weak entity on the entity-relationship diagram by drawing a double box around the entity, as shown in the diagram below.

DEPENDENT is a weak entity because it uses the primary key of the EMPLOYEE entity as part of its own primary key.

A weak entity on the entity-relationship diagram by drawing a double box around the entity.