One-To-Many Recursive Relationship
ER diagram, implementation, and queries of 1:* unary relationship
Table of Contents
· Overview
· ER Diagram
· Implementation
· Queries
· Test yourself!
· References
Overview
A recursive relationship, also called unary, represents self-referencing. There is only one entity set participating in the relationship.
… a recursive relationship is one in which a relationship can exist between occurrences of the same entity set. (Coronel et al., 2020:189)
A recursive relationship is a relationship type where the same entity type participates more than once in different roles. (Connolly & Begg, 2015:412)
There are three types of recursive relationships.
- One-to-one. For example, an employee may be married to one and only one other employee.
- One-to-many, e.g., an employee supervises many employees, and each employee is supervised by only one employee.
- Many-to-many. A course may have many different courses as prerequisites, and a course may be a prerequisite to many other courses.
This article focuses on the one-to-many unary relationship in the case of employees covering the ER model, implementation, and queries.