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:...
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:
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.
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.
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.
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.