Weak Entity and Strong Entity in DBMS

Weak Entity And Strong Entity in DBMS

Weak Entity And Strong Entity in DBMS

Weak Entity and Strong Entity in DBMS – A strong entity is an independent entity with a primary key that uniquely identifies its records. In contrast, a weak entity lacks a primary key and relies on a strong entity for identification, using a foreign key. The relationship between them is called an identifying relationship, which ensures the weak entity’s existence depends on the strong one.

On this page, 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 .

Weak Entity and Strong Entity

What is Weak and Strong Entity in DBMS?

Strong Entity in DBMS

  • Strong Entity is independent of any other entity in the schema

Example – A student entity can exist without needing any other entity in the schema or a course entity can exist without needing any other entity in the schema

  • A Strong entity is nothing but an entity set  having a primary key attribute or a table that consists of a primary key column

Representation 

  • The strong entity is represented by a single rectangle.
  • The relationship between two strong entities is represented by a single diamond.

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
  • In the same way, the course entity contains of course ID attribute which is capable of uniquely accessing each row.
Strong entity in DBMS
Strong entity in DBMS

Weak Entity in DBMS

  • A weak entity is an entity set that does not have sufficient attributes for Unique Identification of its records.

Example 1 – A loan entity can not be created for a customer if the customer doesn’t exist

Example 2 – A dependents list entity can not be created if the employee doesn’t exist

  • Simply a weak entity is nothing but an entity that does not have a primary key attribute 
  • It contains a partial key called a discriminator which helps in identifying a group of entities from the entity set 
  • A 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 a weak entity which is known as identifying relationship 
Weak entity 1 in DBMS
Weak entity 1 in DBMS

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Difference between Strong and Weak Entity in DBMS

Strong entityWeak entity
Strong entity always has a primary key.It will not have a primary key but it has partial discriminator key.
It is not dependent on any other entity.Weak entity is dependent on the strong entity.
Represented by a single rectangle.Represented by double rectangle.
Relationship between two strong entities is represented by a single diamond.Relationship between a strong entity and the weak entity is represented by double Diamond.
A strong entity may or may not have total participation.It has always total participation.

Example of Strong and Weak Entity in DBMS

Example for weak entity

    • In the ER diagram, we have two entities Employee and Dependents.
    • Employee is a strong entity because it has a primary key attribute called Employee number (Employee_No) which is capable of uniquely identifying all the employee.
    • Unlike Employee, Dependents is weak entity because it does not have any primary key .
    • D_Name along with the Employee_No can uniquly identfy the records of Depends. So here the D_Name (Depends Name) is partial key.
Weak entity 2 in DBMS
Weak entity 2 in DBMS

Example for Strong Entity in DBMS

  • What is a Strong Entity?
    A strong entity is an independent object in a database that can exist on its own. It doesn’t need any other entity to be identified.
  • Example in the Image:
    In the image, Employee and Dependents are both shown as strong entities, meaning they have their own unique attributes and can be identified independently.
  • Attributes of Employee:
    The Employee entity has strong attributes like employee_id (which uniquely identifies each employee) and employee_name.
  • Attributes of Dependents:
    The Dependents entity also has its own attributes like d_name (dependent’s name) and Age, which make it a strong entity in this example.
  • Relationship Between Entities:
    The two strong entities are connected by a strong relationship called has, showing that an employee can have dependents.
Example of Strong Entity in DBMS

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription