You are on page 1of 9

Advanced Data Modeling

Chapter 3
Recursive Relationships
Recursive Relationships
• When an entity has a relationship with itself
BCD Consulting Company
Requirements Analysis
• Some employees are managers. Of course, managers are
employees, but not all employees are managers. Each employee,
except the CEO, is supervised by one manager. We need to store
each employee's manager. Sometimes, a manager may not have
any employees reporting to him/her

• Note: The purpose is to identify who supervises each employee.


Not to identify if an employee is a manager
Recursive Relationships
• Business Rules:
– Each employee, except the CEO, is supervised by one manager
– Managers are employees
– Not all employees are managers
– Each manager may supervise many employees
– A manager may not have any employees reporting to him/her
MANAGER : EMPLOYEE Relationship
Problems using Two Entities
• Each manager is also an employee
• Creating the second entity (MANAGER) duplicates data from the
EMPLOYEE entity
• Having two entities virtually guarantees mistakes and conflicts in
the database

• Fix the problem by creating a recursive relationship


EMPLOYEE Recursive Relationships
• Connects a single entity (serving in one role) to itself (serving in
another role)
EMPLOYEE Recursive Relationships
9

You might also like