What is Weak Entity Set is Represented As?
![DBMS Course - Master the Fundamentals and Advanced Concepts](https://www.scaler.com/topics/images/srikant-varma_instructor.webp)
What is a Weak Entity Set?
Each entity type should have a key attribute that uniquely identifies each entity in the entity set. However, some entity types exist for which the key attribute is not defined. And the name of that entity is Weak Entity.
A weak entity set is an entity set that does not contain sufficient attributes to identify its records uniquely. The entity set that has sufficient attributes to identify its records uniquely is called a strong entity. In more simple words, a weak entity is an entity that does not have a primary key attribute.
As we can see, a weak entity does not have a primary key, so it can’t be identified uniquely. That’s why they depend on some other entity, which is known as the owner entity. Like a strong entity, the weak entity does not have any primary keys, it has a discriminator key.
Weak Entity Set Representation
The weak entity set is represented as a double rectangle box in the ER diagram and the double diamond represents the relationship between a strong entity and the weak entity.
Symbols Used in a Weak Entity Set
We use various figures for the representation of weak entity sets.
Let's see what a weak entity set is represented as.
- A double rectangle is used to represent a weak entity set.
- A double diamond symbol is used to represent the relationship that exists between the strong and weak entity sets, and this relationship is known as the identifying relationship.
- A double line is used to represent the connection between the weak entity set and the relationship set.
- Total participation always exists in the identifying relationship.
Representation of Weak Entity Set
As you can see in the above figure, a double line represents the total participation of the entity; the double diamond box represents the identifying relationship set; the double rectangle represents the weak entity set, and the dotted line represents the discriminator or partial key.
Examples of Weak Entity Set
Example 1:
Here we have two entity types: Professor and Dependent. The professor entity has attributes such as ID, Name, Salary, and City. And the dependent entity has attributes like Name, DOB, and Relation. Here, ID is the key attribute of the entity Professor, and Name is the key attribute of the entity Dependent. Here, the professor is the strong key, dependent is represented as a weak entity set. All the professor entities may not be related to one or the other dependent entity, but all the dependent entities are related to one or the other professor entity. This is called "total participation". The strong entity principle is used to identify weak entity dependents. It means there is a relationship between these two entities. This is called "identifying relationships".
Example 2:
In the above ER Diagram, the loan number is the primary key of the strong entity officer. The weak entity is "payment", and the payment number is the discriminator of the weak entity's set payment. ‘Loan Payment’ is the identifying relationship. The double line between the loan payment and the payment set signifies total participation. The primary key of the loan along with the partial key would be used to identify the records.
Example 3:
The rooms in the hotels depend on the existence of the hotel. That’s why rooms can be the weak entity of the hotel.
Example 4:
An entity set of cars having attributes such as a car's color, and a car's name is a weak entity since two cars can have the same color as well as the same name. So, none of the attributes can be considered the primary key, and hence the entity set is weak.
Differences Between Strong Entity Set and Weak Entity Set
Strong Entity Set | Weak Entity Set |
---|---|
A strong entity set represented by a single rectangle. | A weak entity set represented as a double rectangle. |
Strong entities always have a primary key. | The weak entity set does not have any primary key but it has a partial discriminator key. |
The relationship between two strong entities is represented by a single diamond. | The relationship between two weak entities is represented by a double diamond. |
They might have a 1:M, M:M, M:1 or 1:1 relationship with any other entity set. | They must have a 1:M relationship. |
A strong entity may not have total participation. | A weak entity always has total participation. |
Learn More
You can learn more about entities from the below link:
Conclusion
- A weak entity set is an entity set that does not contain sufficient attributes to uniquely identify its records.
- A weak entity does not have a primary key, which means it can’t be identified uniquely.
- The weak entity is represented as a double rectangle box in the ER diagram and for the relationship, a double diamond is used.
- Strong and weak entity sets have a parent-child relationship.