Types of Relationships in ER Diagram (ER Model-Part-3)

Types of Relationships in ER Diagram

Relationship or Relationship Set :  

Relationships connect the entities and represent meaningful dependencies between them.It represents an association among several entities. Relationships sets is a set of relationships of the same type. It is a mathematical relation on entity sets (n>=2). Relationship set R is a subset of –
{(r1,r2,r3,....rn)| r1∈E1, r2∈E2, rn∈En}
where r1,r2,….rn are called relationships and E1,E2,….En are entity sets. The way in which two or more entity types are related is called relation type. For example, consider a relationship type WORKS_FOR between the two entity types EMPLOYEE and DEPARTMENT, which associates or links each employee with the department the employee works for. The WORKS_FOR relation type is shown as – relationship set example-Types of Relationships in ER Diagram

Binary Relationship-Types of Relationships in ER Diagram In the above figure, each instance of relation type WORKS_FOR i.e.(r1, r2,…,r5) is connected to instances of employee and department entities. Employee e1, e2 and e5 work for department  d2 and employee e3 and e4 work for department d1.

Notation to Represent Relation Type in ER Diagram-

Relation types are represented as diamond shaped boxes. Relarionship Notation (Types of Relationships in ER Diagram)

Degree of a Relationship Type-

The number of participating entity types is known as the degree of relationship type.

Types of Relationship Type Based on Degree –

  • Binary Relationship – A relationship type of degree two is called binary relationship. The WORKS_FOR in above figure is a binary relationship as  there are two participating entities-employee and department. Binary Relationship-Types of Relationships in ER Diagram
  • Ternary Relationship- A relationship type of degree three is a ternary relationship for example, in the below figure supply relationship connects three entities SUPPLIER, PART AND PROJECT. Ternary Relationship-Types of Relationships in ER Diagram The above diagram can be read as – a supplier supplies the parts to projects
  • N-ary Relationship Set – A relationship type of degree n is called n ary relationship . For example
N-Array Relationship Set

Role Names-

A relationship type has a name which signifies what role a participating entity plays in that relationship instance. The role names helps to explain what the  relationship means. In the first example WORKS_FOR  relationship type, employee plays the role of worker and department plays the role of employee(because a department consists of a number of employees.

Recursive  Relationships-

If the same entity type participate more than once in a  relationship type in different roles then such  relationship types are called recursive  relationships. For example, in the below figure REPORTS_TO is a recursive relationship as the Employee entity type plays two roles – 1) Supervisor and 2) Subordinate. Recursive Relation-types of relationships in er diagram  
Previous Home Next
Type of Attributes in DBMS Relationship Constraints in DBMS

]]>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top