Cardinality Ratio of a Binary Relationship
For Complete YouTube Video: Click Here
In this class, we will understand the Cardinality Ratio of a Binary Relationship.
We have already discussed the concepts of Identifying Relationship Types.
Table of Contents
Cardinality Ratio of a Binary Relationship
Cardinality Ratio
The cardinality Ratio of a Binary Relationship specifies the maximum number of relationship instances an entity can participate.
As shown below, we will try to understand this concept by using the ER Diagram that we have obtained so far.
We will also consider the relationship instances for the entities of the entity types, as shown below.
The above images for the works_for relationship state that each employee entity has a maximum participation of one.
The department entity has more than one participation of relationship instances so that we will consider the ‘maximum involvement of the department as N.
The cardinality ratio of the works_for relationship is 1:N.
We cannot decide the cardinality ratio of the relationship just by the relationship instance diagram.
We have to conclude from the requirements.
In the requirements, we have this statement “An employee is assigned to one department.”
From the above statement, we can conclude that an employee can work in only one department.
It is simply common sense that a department will have more than one employee.
We cannot run a department with one employee.
From that, we can conclude that the cardinality ratio for the works_for relationship is 1:n.
Similarly, if we consider the manages relationship type, the cardinality ratio is 1:1.
The cardinality ratio of 1:1 comes from the statements that an employee may manage only one department, and a department will have only one manager.
Not all employees will manage the departments even though some of the employee’s participation is zero.
We have to consider only the maximum participation.
Considering the maximum participation is called as cardinality ratio.
ER-Diagram representation
How can we represent the cardinality ratios in the ER Diagram?
As shown below, we can represent the entity type’s maximum participation on the opposite entity type.