FOR FREE CONTENT

Relationship (ER Diagram)

 

Introduction of Relationship (ER Diagram)  [Important for examination]

Relationship is an association between two or more entities. 

 

For example, an association of Student Saheli with Course C100 describes that Saheli is enrolled in Course C100.

As we know Verb treated as a Relationship.

 

NoteRelationship and Relationship Type refer to the same thing.

 

Now we take a description and try to design a relationship

Example: Every Employee works for exactly a Department and a Department can have many employees. Now there may be some Department which is new and initially need not have any Employee.

 

Now from this description, we can differentiate entity and relationship.

‘Employee’and ‘Department’– entity

‘works for’ – relation

 

From this description, it is clear that every Employee works for exactly one department and more than one employee can work for one department.

So, the relationship from employee to the department is one: many

 

Some important terminology related to relationship:  [Important for exam]

1. DegreeThe number of entities present in a relationship is called the degree of the relationship.

   For above example has two entities so, in that case, the degree is 2.

 

2. Cardinality (unlike set theory): Maximum no. of relationship in which an entity can participate. 

If we consider the above example calculate the cardinality of Employee and Department.

 

Cardinality of Employee: The maximum number of the relationship made by Employee is 1 (one) because every Employee works for exactly one Department

So, the cardinality of Employee is 1

 

Cardinality of Department: Maximum number of relationships made by the department is 4 (four) we can say many (more than one we can be treated as many) because one department can have many employees.

So, the cardinality of Department is 4 (four) means many

 

3.  Participation: Minimum no. of relationship in which an entity can participate.

If we consider the above example:

 

Participation of employee: Minimum number relationship made by the Employee is 1(one) because ‘every Employee works for exactly a Department’ means there is no employee who does not works any Department.

 

So, the participation of Employee is 1 (one). If any entity hasparticipation then it is called total participation

 

Participation of Department: Minimum number of relationships made by the Department is 0 (zero) because ‘some Department which is new and initially need not have any Employee here d3 does not have any employee.

 

So,  participation of  Department is 0 (zero). If any entity hasparticipation then it is called partial participation.

 

Now how we represent cardinality and participation of entities in ER diagram: 

Three ways we can represent cardinality and participation in ER diagram as below:

1. 

 

2. 

 

Important note for exams:

Put cardinality in reverse order, a double line is total participation and single line means partial participation. This representation called as Cardinality ratio / Single line – Double line.

 

3. Another method

 

This representation called minimum – maximum method.