CodeMaster
Article ID: 2435
dbms
2 min read
Entity and Its Types

ENTITY AND ITS TYPES An Entity is something from the real world, like a person, place, event, or idea. Each entity has specific features or traits that describe it. There are two types of entities:...

CS Core
October 5, 2024
Tutorial Article

Entity and its types

An Entity is something from the real world, like a person, place, event, or idea. Each entity has specific features or traits that describe it.

There are two types of entities:

Strong Entity

A strong entity is an entity that has its unique identifier (primary key) and is not dependent on any other entity for its existence within the database. Strong entities stand alone and have their own set of attributes. For Example- An entity “person” can exist independently.

Weak Entity

A weak entity is an entity that doesn't have a primary key of its own. It relies on a related strong entity (known as the "owner" entity) for its identity. The weak entity’s existence is defined by being related to the owner entity. For example- In a company, employees can file for dependents under their name. In this case, the entity, “Dependents” is weak.

Strong Entity Example

From the figure, it can be seen that the “Student” table is a strong entity as it can exist independently. However, the “Course” table has a foreign key of S.ID (as explained here). This makes the “course” entity dependent on the “Student” entity. Hence, the “course” entity is a weak entity.

Weak Entity Example

In the ER Model, the strong entity is represented in a rectangle, the weak entity in a double-edge rectangle and their relationship in a double-edged diamond shape, as shown in the figure.

Special thanks to Kuhuk Agarwal and Gauri Tomar for contributing to this article on takeUforward. If you also wish to share your knowledge with the takeUforward fam, please check out this article.