
Introduction
Before directly discussing what is a weak entity, let us first get familiar with its roots.
Any facts in the form of text, number, images, etc. that can be recorded are referred to as data, and the collection of such data related to each other are referred to as database and the software managing the database is called Database management system.
These data represent real-world objects categorised as entities in technical terms. Now let us focus on our topic of what is a weak entity.
Must Recommended Topic, Generalization in DBMS
What is a weak entity
Before understanding what is a weak entity, we must know that entities are generally of 2 types: strong entity and weak entity.
Now we will be discussing what is a weak entity.
Generally, in any entity type, we will have lots of entities. For example, if we take an entity type, say, employee, we will have many employees. Now the question arises of how we can distinguish one employee from another employee. So, just to answer that, we would have a uniqueness constraint. Actually, we are doing to have some special attributes called key attributes. Say, for example, here is the employee number.
Next the question arises is how to identify the key attributes?
So, this is from requirement analysis; whenever we talk to the users, we say that we have these many employees, and out of all these employees, we will give them some identity cards. Every identity card will have a unique number to identify them. Once we fix the key attribute, we must always check while inserting a new entity that this key attribute value should always be unique.
Sometimes, more than one attribute qualify to become a key attribute. For example, engine number, registration number and manufacturer number can be key attributes in a car. As a database engineer, one has the liberty to choose any one of these attributes as key attributes.
But the problem arises when no attributes qualify to become a key attribute. Say, for example, dependent of employees, here all dependents can’t be assigned with some employee id.
Here employees can be easily identified uniquely using employee IDs but dependent does not have any key attributes. Say, the attributes present in dependent are name, age and relation. So, there exist the possibility that the same name, age and relation may reappear. Such an entity which do not consist of key attributes is referred to as a weak entity. And if the entity has key attributes, it is referred to as a strong entity. Here dependent is an example of a weak entity, and employee is an example of a strong entity. Hence we have got the answer to our question of what is a weak entity.
Now to overcome this problem of uniqueness, every weak entity has to be related to strong entity through a relationship. This relationship is called an identifying relationship. This relationship is mandatory for the existence of a weak entity.
ER diagram for a weak entity can be represented as:
Must Recommended Topic, Schema in DBMS