If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Having trouble with an ERD relationship between an EMPLOYEE, MANAGER, & DEPARTARTMENT

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-10, 20:20
chadsxe chadsxe is offline
Registered User
 
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
Reply With Quote
  #2 (permalink)  
Old 09-09-10, 11:16
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
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.
Reply With Quote
  #3 (permalink)  
Old 09-09-10, 11:43
chadsxe chadsxe is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 09-09-10, 11:57
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
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?
Reply With Quote
  #5 (permalink)  
Old 09-09-10, 12:07
chadsxe chadsxe is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On