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 > Table design for roster system

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-04, 16:02
nqaul nqaul is offline
Registered User
 
Join Date: Nov 2004
Posts: 2
Table design for roster system

Hello there.

I'm designing a database to be used in a roster system.
The tables will need to hold the following info.

roster_id(0,1,2....)
staff_id
roster_startdate/enddate
staff_hours (unique to each staff member, one per day)
assigned duty

I was thinking along this sort of line:


Roster_Table
r_id,
sdate
edate

Staff_Hours_Table
staff_id
date
hours
duty



I can do the query to pull the info i want out but the tables just
don't feel right. Its a while since I've done any DB work so maybe
I'm missing something but should there not be a forigen key relationship
between these. Also the staff_id and date in Staff_hours jointly form
the primary key I'd rather not have this either.

Any help will be very greatly appriciated.
Reply With Quote
  #2 (permalink)  
Old 11-12-04, 23:05
certus certus is offline
Registered User
 
Join Date: Dec 2003
Location: Canada
Posts: 710
You need something like the following

Staff(StaffID, StaffName)

Roster(RosterID, StartDate, EndDate)

Date(DateID, DateName) This gives you a Date Dimension.

DutyRoster(RosterID, StaffID, DateID, Duty, Hours)

You would have to enforce a composite unique key on the three IDs which is kosher.
__________________
visit: relationary
Reply With Quote
  #3 (permalink)  
Old 11-13-04, 12:58
nqaul nqaul is offline
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks

Cheers mate that'll work a threat I think
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