Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010
    Posts
    6

    Having trouble with an ERD relationship between an EMPLOYEE, MANAGER, & DEPARTARTMENT

    Hi,

    Let me start by saying I am new to database design. I have been programming for 5 years now but recently felt like it would be of worth to learn about databases and database design. I picked up a few books and am now working my way through them. So without further ado, hear is my first question.

    I am currently trying to understand and learn how to use the Entity Relationship Model. One of the books I am reading asks me to conceptualize a basic ERD showing the relationships between a Department, Employee, and Manager. The book offered me up these business rules….

    • Each department has many employees, but each employee belongs to one department.
    • Each department is managed by one employee, and each of those managers can manage only one department.


    My first atttempt

    So what I am confused about is if a manager is an employee how do I represent that relatiomship.

    Regards

    Cjad

  2. #2
    Join Date
    May 2008
    Posts
    277
    In your example, you've described two entities (employee, department) and two relationships (works in, manages). There's no reason two entities can't have more than one relationship between them.

  3. #3
    Join Date
    Sep 2010
    Posts
    6
    Quote Originally Posted by futurity View Post
    In your example, you've described two entities (employee, department) and two relationships (works in, manages). There's no reason two entities can't have more than one relationship between them.
    I might be thinking to far ahead but what happens if when employee becomes a manager he/she has more attributes to be considered. Does not that call for the third entity?

    Regards

    Chad

  4. #4
    Join Date
    May 2008
    Posts
    277
    In general, you'll want to look at a technique called subtyping to see how to handle situations like this.

    Specifically, modeling people, organizations, and the relationships between them tends to get complicated. There are a number of "universal"/"generic" models that people have developed to solve this problem, and I generally use some form of them in my own designs. They also serve as good, educational examples of how to create good data models.

    A Universal Person and Organization Data Model
    Is Your Organization Too Unique to Use Universal Data Models?

  5. #5
    Join Date
    Sep 2010
    Posts
    6

    caterion bq

    Quote Originally Posted by futurity View Post
    In general, you'll want to look at a technique called subtyping to see how to handle situations like this.

    Specifically, modeling people, organizations, and the relationships between them tends to get complicated. There are a number of "universal"/"generic" models that people have developed to solve this problem, and I generally use some form of them in my own designs. They also serve as good, educational examples of how to create good data models.

    A Universal Person and Organization Data Model
    Is Your Organization Too Unique to Use Universal Data Models?
    Thanks for the information. I am going to take a look at those articles now. Like I said I might be thinking a bit to far ahead at this point, being I just started learning this.

    Again - thank you

    Regards

    Chad

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •