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 > enhanced ERD help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-06, 12:10
monkeymafia monkeymafia is offline
Registered User
 
Join Date: Nov 2006
Posts: 20
enhanced ERD help

hi could anybody please offer me a little bit of advice for a ERD that i have to produce.
just a little background. i have to design a ERD for an elephant sanctuary and i am just having trouble getting my head round the relationships between employee, volunteer adn managers with the sanctuary.

So far i have the following:
http://img.photobucket.com/albums/v6...afia66/erd.jpg

i know that volunteer needs to be a subclass of employee because it shares the same attributes as employee as they are given a temporary employee id just wasnt sure whether to do a disjointed sublcass with manager. does this look okay?
it states that there are pre definied arrival dates and the system needs to record which date the volunteers are arrive and when they leave from the sanctuary. how would i present this? the volunteers also share a bungalow and the system needs to record which room has beeen allocated.
would i create a weak entity called bungalow?
Reply With Quote
  #2 (permalink)  
Old 11-02-06, 15:41
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Volunteers should be stored in the same table as Employee, and simply marked as "Volunteer" or "Unpaid". Ideally, Managers should also be in the Employees table, with a self-referencing foreign from each Employee record to the Employee record of its manager.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 11-02-06, 15:51
monkeymafia monkeymafia is offline
Registered User
 
Join Date: Nov 2006
Posts: 20
hey thanks for the reply. so your saying that volunteer should be an attribute of employee?
another thing i forgot to mention and show in the diagram is that the volunteer entity has extra attritbutes (email, passport number and insurance details) plus it shares all the attributes of the employee entity. thats why i decided to make it a subclass of employee. well it seemed to make sense?
Reply With Quote
  #4 (permalink)  
Old 11-03-06, 10:04
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
What, employees can't have e-mails, passports, or insurance details?

Yes, "Volunteer" is an attribute of employee. Go ahead and include the volunteer-specific attributes in the Employees table, even if they are not used for all records. In database design, we try to avoid splitting out data into separate tables. You can think of database schemas being partially object oriented (especially 3rd normal form designs), but they do not have inheritance between tables.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #5 (permalink)  
Old 11-06-06, 06:59
monkeymafia monkeymafia is offline
Registered User
 
Join Date: Nov 2006
Posts: 20
yeh only volunteers have passport number, insurance details (composite). they also have a start and leave date. so Persumambly i create a separate relation to the company from the actual employees?
volunteers are also given a temporary employee id. would it be sensible to create another attribute called Volunteer id?
thanks again
Reply With Quote
  #6 (permalink)  
Old 11-06-06, 09:29
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
No, you should do exactly what I keep telling you to do.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #7 (permalink)  
Old 11-06-06, 14:38
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Quote:
Originally Posted by blindman
No, you should do exactly what I keep telling you to do.
Even though I agree wholeheartedly in this case, the mere thought of telling someone that they should blindly do what a blindman says just frightens me... Particularly a blindman that may be a crustier curmudgeon than I am!

-PatP
Reply With Quote
  #8 (permalink)  
Old 11-06-06, 15:17
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
As long as Rudy is on the forum I am at most Crusty Curmudgeon #2.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #9 (permalink)  
Old 11-06-06, 15:47
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
but honestly, i am trying to be more friendly lately...

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #10 (permalink)  
Old 11-06-06, 16:24
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Yay! I'm #1! I'm #1!
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
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