Weak Entity Set and Strong Entity Set in DBMS

November 6, 2020

An entity in DBMS can be a real-world object with physical existence. Here we discuss and compare the Weak Entity Set and Strong Entity Set in DBMS.

It defines the type of data stored in the database which is nothing but simply a database table. For example, in a college database, the entity can be a professor, student, courses, etc. Simply, it can be a person, office, house, car, etc that have a physical existence.

Attributes that describe the properties of an Entity. Attributes are based on a conceptual existence, such as school, university, job, etc. For example, for a student entity, the corresponding attributes are Stud_name, Stud_Id, Stud_class, Stud_marks, etc. The values of attributes will be stored in the database.

In the ER diagram,

  • Attributes are associated with an Entity set.
  • Attributes describe the properties of entities present in the entity set.
  • Based on the values of certain attributes, an entity can be identified distinctly.

Example of Entity in DBMS

Student Table

Weak Entity Set and Strong Entity Set in DBMS

Here, Student_Id, Student_Name, Student_Class, and Student_Marks are attributes of the entity student and Student_Id is the primary-Key among them.

Weak Entity Set and Strong Entity Set in DBMS

Generally, Entities may be of the following two types:

Weak Entity Set and Strong Entity Set in DBMS - figure 2

Strong Entity Set

  •  A Strong Entity Set is defined as an entity set that contains sufficient attributes to uniquely identify all its entities.
  • In general, a primary key exists for a Strong Entity Set.
  • The primary key of a Strong Entity Set is represented by simply underlining it.

Representation

Weak Entity Set and Strong Entity Set in DBMS - figure 3

  • Every Strong represented by using a rectangle.
  • The relation between two Strong Entities is represented by a single Rhombus.

Example of a Strong Entity

Example of a Strong Entity

  • Consider the ER diagram which is comprised of two entities Student and Course.
  • Here, the Student entity is a Strong Entity, because a Primary key Student_Id is present. So it is enough for accessing each record uniquely.
  • Course Entity consists of the attribute Course_Id which is capable to access each row of records uniquely. It means each course detail can be accessed separately.

Weak Entity Set

  • A Weak Entity is defined as an Entity Set that does not have sufficient attributes for the unique identification of its corresponding records.
  • A Weak Entity is nothing but simply an entity that does not have a primary key attribute.
  • It consists of a partial key known as Discriminator which helps in identifying a group of entities from the Entity Set.
  • The discriminator is represented by using an underline with a dashed line.

Representation

Weak Entity Set and Strong Entity Set in DBMS - figure 4

  • A Weak Entity Set is usually representing using a double rectangle.
  • The double diamond or Rhombus symbol is used for representing the relationship between a Strong Entity and a Weak Entity. It is generally known as Identifying Relationships.
  • For the presentation of the connection with a Weak  Entity Set with a relationship, double lines are typically used.

Example of  Weak Entity

Example of  Weak Entity

  • Here, we have two Entities such as Building and Apartment that are presented in the ER diagram.
  • Strong Entity is Building here because it has a primary key attribute namely Building_No which is capable to identify all the flats present in the Apartment distinctly.
  • Unlike Building, Apartment is a weak Entity because it does not contain any primary key and Door_No here acts only as a Discriminator. Because Door_No cannot be considered as a primary key, there might be multiple flats in the building having the same Door_No or on different floors.

Weak Entity Set v/s Strong Entity Set

Strong Entity Set

  • Strong Entity always have a primary key
  • It is independent of any other Entity.
  • It is represented using a single rectangle.
  • The relationship between the two Strong Entities represents using a single diamond.
  • Generally, a Strong Entity may or may not have total participation.

Weak Entity Set

  • This entity will not have a primary key, but instead having a partial discriminator key.
  • The Entity which is dependent on the Strong Entity Set to distinguish its Entities.
  • It is represented using a double rectangle and the relationship between a Strong Entity and the weak Entity is represented by a double diamond symbol.
  • Always, it has total participation.
  • The primary key of the Weak Entity Set is also the primary key of its identifying Strong Entity Set + partial key of the Weak Entity Set.

Identifying a Weak Entity with the help of a Strong Entity Uniquely

  • First of all, Building_No is necessary to identify a particular building.
  • Then, the Door_No of the corresponding Apartment is required for identifying the Apartment uniquely.
  • Therefore, generally the primary key of the Apartment= primary key of Building + Its own discriminator.

Tagged in: ,