Weak Entity and Strong Entity in DBMS

Weak Entity and Strong Entity in DBMS 

In this article, we will learn about Weak Entity and Strong Entity in DBMS.

The entity defines the type of data stored, simply it is nothing but a database table . We have the following two types of entities based on Unique Identification –

  1. Strong entity
  2. Weak entity

Strong entity 

  • A strong entity set is an entity that contains sufficient attributes to uniquely identify all its entities 
  •  Simply strong entity is nothing but an entity set  having a primary key attribute or a table which consists of a primary key column
  • The primary key of the strong entity is represented by underlining it 
Representation 
    • The strong entity is represented by a single rectangle
    • Relationship between two strong entities is represented by a single diamond.
Strong Entity in DBMS
Examples for the strong entity 
    • Consider the ER diagram which consists of two entities student and course
    • Student entity is a strong entity because it consists of a primary key called student id which is enough for accessing  each record uniquely
    • The same way, course entity contains of course ID attribute which is capable of uniquely accessing each row it is each course details

Weak entity 

  • A weak entity is an entity set that does not have sufficient attributes for Unique Identification of its records 
  • Simply a weak entity  is nothing but an entity which does not have a primary key attribute 
  •  It contains a partial key called as discriminator which helps in identifying a group of entities from the entity set 
  • Discriminator is represented by underlining with a dashed line 
 Representation 
    • A double rectangle is used for representing a weak entity set
    • The double diamond symbol is used for representing the relationship between a strong entity and weak entity which is known as identifying relationship 
    • Double lines are used for presenting the connection with a weak entity set with relationship 
Weak Entity in DBMS
Example for weak entity  
    • In the ER diagram, we have two entities building and apartment
    • Building is a strong entity because it has a primary key attribute called building number which is capable of uniquely identifying all the flats present in the apartment 
    • Unlike building, apartment is weak entity because it does not have any primary key and door number here acts only as a discriminator because door number cannot be used as a primary key, there might be multiple flats in the building with the same door number or on different floors.

Strong entity vs Weak entity 

Strong entity 

 

  • Strong entity always has a primary key
  • It is not dependent on any other entity
  • Represented by a single rectangle 
  • Relationship between two strong entities is represented by a single diamond
  • A strong entity has  may or may not have total participation
Weak entity

 

  • Will not have a primary key but it has partial discriminator key 
  • Which entity is dependent on the strong entity
  • Represented by double rectangle relationship between a strong entity and the weak entity is represented by double Diamond
  • It has always total participation

 

To uniquely identify a weak entity with the help of a strong entity

  • First, building number is required to identify the particular building.
  • Secondly, the door number of the apartment is required to uniquely identify the apartment. 
  • Thus,The primary key of Apartment= Primary key of Building + Its own discriminator
Learn more about DBMS here on this page.