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 > Rota normalisation for project [homework]

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-11, 21:38
fr0s1yjack fr0s1yjack is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
Rota normalisation for project [homework]

Hi,

Ok, I am creating a small application that handles a staff rota and have some data that needs normalising, I am familiar with the process however I've never normalised grid data before, let me explain..

here are the fields:

userID (this is included so each staff member can log in independantly, coinciding with other parts of the application)
Location (this is typically the same)
Week Beginning
Week
Dept (typically the same)
staffName
Monday
Tuesday
Wednesday
Friday
Saturday
Sunday
Date
Hours Owed (calculated, so not to be included)


The raw data is a simple excel spreadsheet, with the days of the week across the top, the staff names down the side and shifts populating the rest i.e 8-8, 12-4 etc.

What I need to figure out is the repeating data, the rest will follow

I spoke with my tutor who reckoned I go with the days of the week as the repeating data, I dont agree. Here is what I reckon to be the repeating data, indented (as the data is repeated over and over):

userID
Location
Week Beginning
Week
Dept
staffName
Monday
Tuesday
Wednesday
Friday
Saturday
Sunday
Date


although even that I'm struggling to make sense of, as the repeating group also needs taking to 1NF.

Any thoughts?
Reply With Quote
  #2 (permalink)  
Old 04-16-11, 21:40
fr0s1yjack fr0s1yjack is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
lol, i did indent it however obviously not correct here are the fields i think to be repeating:


userID
Location
Week Beginning
Week
Dept
staffName
Reply With Quote
  #3 (permalink)  
Old 04-17-11, 03:44
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
if you look at the rota data independently of how you want it displayed, then it normalizes quite easily --

Location
userID
assigneddate
shift

in other words, you are assigning a shift value (i.e. 8-8, 12-4 etc.) to a particular person at a particular location on a particular date

that's the repeating data taken care of

then you'll have other normalizations to do, such as not stuffing the user's name into this table

displaying the results nicely in "rota" style, one page per location per week, days across the top, staff down the left -- that's the job of the application code
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 04-17-11, 12:48
fr0s1yjack fr0s1yjack is offline
Registered User
 
Join Date: Apr 2011
Posts: 21
thanks for taking a look at it, makes sense now!!

Your right once you get the fields down its just like any other data, i can get cracking with this now, no problem!

Yeah that was poor foresight on my part about the 'staffName'!

thanks so much again!!
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