• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 7. Working with Relationships > Creating Self-Relationships

Creating Self-Relationships

A self-relationship sounds like another dubious (if not illegal) concept. We assure you it's just one more tool in the database developer's arsenal. Self-relationships are an important tool even at the ERD level, though we didn't explore them in Chapter 5. We'll go into some detail here on how to create and use them.

Managers and Employees: A “Structural” Self-Relationship

Suppose you want to create a database system that models a company's organization chart. Your process description tells you that the system should show, for each employee, who that employee's manager is, and for each manager, a list of all that manager's direct reports. On the strength of this, you draw an ERD like that in Figure 7.10, with two separate entities, Manager and Employee, in a one-to-many relationship.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint