Normalization from an excel form

  • Hey guys, I have some problems with normalizing the data.

    Could you take a look at this file

    http://speedy.sh/YtK9G/example.xlsx

    These is the list of attributes: week site day timeSlot employee role sick totalHrs

    Week and site will be a compound key.

    A lot of things confuses me here so I'd really appreciate your help.

    Thanks in advance 🙂

  • If you take a look at the Microsoft example database called AdventureWorks, it has a very similar structure to what you're looking for:

    http://msdn.microsoft.com/en-us/library/ms124438%28v=sql.100%29.aspx

    Specifically look at the HumanResources.Shift, HumanResources.Employee

    You need separate tables for Site (ID name location purpose), Employee (ID name occupation), Day (ID, Name), EmploymentRole (ID, rolename), TimeSlot(ID Start and end times - no dates), Sick(Maps Timeslot & Employee), ShiftRecord (Maps EmpID, DayID, TimeSlotID, RoleID)

    Then use excel to link to these tables with dropdown selection list (MyList function).

  • Thanks.

    That thing exactly confuses me, because trying to do top - down approach for this case I know I will need a separate table for almost every attribute here.

    But I'm not really quite sure how to go about bottom-up approach. I know the rules of normalization, and that should be enough, but still...

    UNF: week site day timeSlot* employee* role* sick* totalHrs*

    Let me try do the 1NF (I should break out repeated groups to form new group and include original key as a foreign key), so:

    1NF:

    1) week site day (should I put the day attribute here? the data itself does not repeat in the form)

    2) employee week site timeSlot role sick totalHrs

    What do you think about it? Is that ok?

  • Oh I see, OK, I don't think 1 is correct, with {day} there you'll have non unique week site keys, or am I jumping past 1nf..

    IMO, I think it should be

    week site day timeSlot* employee*

    Week day employee sick

    Employee week totalhours

    Its getting a little into 2nf I think though.. but you can still break out further since employee does not depend on week site day etc.. so possibly OK.

  • Thanks again for the response.

    I forgot to mention that I have to get this thing all the way to 3NF.

    There's no employee role in your suggestion.

    I've attempted to go a step further and get it to 2NF and I got:

    week

    site

    day

    employee role

    timeSlot

    site week day employee timeSlot

    employee week totalHours

    Bold attributes are assumed to be IDs.

    Underlined ones are foreign keys.

    As you see I'm still confused. The set of attributes is so varied that I'm tempted to jump in and split them up immediately.

    Unfortunately I have to prepare the formal solution and what should be added in 1NF is supposed to be in 1NF, what in 2NF in 2NF. Else I'll lose some points while being graded 🙂

    Thank you again for your time 🙂

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply