A relationship between two entities is called recursive relationship if the two entities are of similar type. For example: A relationship between a manager and an engineer is a recursive relationship because both manager and employee are employees of the company. Similarly a relationship “marries” between two person is recursive relationship as a person marries to another person, in this example the entity person is has a relationship with itself. In this guide, you will learn how to represent a recursive relationship in an ER diagram.
Recursive relationship in ER diagram
A recursive relationship can be represented in ER diagram as shown below. As you can see this relationship involves Employee entity twice. You can also call it as a relationship to itself. An employee supervises another employee.
Here an Employee supervises another employee. This is one to many relationship as one employee can supervise many employees.
Recursive relation ER diagram with a role name: In this ER diagram, we are depicting the supervises relationship with the role names. This clearly shows that a supervisor employee has a one to many relationship with the supervised employee.
Here we are displaying an employee hierarchy of 8 employees. This diagram shows us that, in this supervisor relationship, the total participation is optional as there are some employees that are not supervised by anyone such as “Chaitanya” and there are some employees, who do not supervise anyone such as Rahul, Jim, Steve, Carl & Ron.
More examples of Recursive relationships
Some other example ER diagrams of recursive relationships: