Nothing Special   »   [go: up one dir, main page]

Open In App

Difference between Strong and Weak Entity

Last Updated : 30 Sep, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

An entity is a “thing” or “object” in the real world. An entity contains attributes, which describe that entity. So anything about which we store information is called an entity. Entities are recorded in the database and must be distinguishable, i.e., easily recognized from the group. In this article, we will see the difference between strong and weak entities.

What is a Strong Entity?

A strong entity is not dependent on any other entity in the schema. A strong entity will always have a primary key. Strong entities are represented by a single rectangle. The relationship of two strong entities is represented by a single diamond. Various strong entities, when combined together, create a strong entity set.

What is a Weak Entity?

A weak entity is dependent on a strong entity to ensure its existence. Unlike a strong entity, a weak entity does not have any primary key. It instead has a partial discriminator key. A weak entity is represented by a double rectangle. The relation between one strong and one weak entity is represented by a double diamond. This relationship is also known as an identifying relationship. 

Strong and Weak Entity

In ER models, strong entities can exist independently, whereas weak entities depend on strong entities. If you want to solidify your understanding of ER diagrams and entity relationships, the GATE CS Self-Paced Course covers database concepts in-depth, including practical exercises on ER modeling

Difference Between Strong and Weak Entity

Strong Entity Weak Entity
Strong entity always has a primary key. While a weak entity has a partial discriminator key.
Strong entity is not dependent on any other entity. Weak entity depends on strong entity.
Strong entity is represented by a single rectangle. Weak entity is represented by a double rectangle.
Two strong entity’s relationship is represented by a single diamond. While the relation between one strong and one weak entity is represented by a double diamond.
Strong entities have either total participation or partial participation. A weak entity has a total participation constraint.

Conclusion

It is important while designing a database to comprehend the difference between strong and weak entities. That is, strong entities have all the necessary attributes for their existence and have unique attributes while weak entities have at least one attribute that depends on the attributes of their related strong entities to form an identification. Its also facilitates help in placing these entities in the right category and defining them properly so that the database created can have the best structure that fits and are efficient in making real-world scenarios.

Difference Between Strong and Weak Entity – FAQs

Primary key can be had by a weak entity?

No, a weak entity does not have it own primary key. On the other hand, it employs a partial key together with the strong entity’s primary key as the composite key.

What is the consequence of delete the strong entity?

This mean that if the strong entity is deleted, the weak entities may also be deleted since they form a dependent relationship with the strong entity. This is usually carried out through check constrains such as referential integrity on the database.

Is it possible to transform weak entity into a strong entity?

The answer to the question is yes, a weak entity can become a strong entity if an attribute could be created which can be made the key of the table and hence it can stand alone.

How do you drawing of weak entities in the ER diagram?

A weak entity is depicted by double rectangular box while the relationship between the strong and weak entity is indicated by a double diamond.


Next Article

Similar Reads

three90RightbarBannerImg