Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2008
    Posts
    4

    Exclamation normalization exercise (was: some other title)

    Hey all,

    Well this is the situation, I am currently studying Computer Science at University and have only studied a little bit of Databases in the past, enough to keep me going when I was doing it, but now I have taken database modules and everyone seems to know what they are doing.

    I am really struggling in terms of trying to understand how to normalize a database!?!? I have looked online at so many different examples, but they all seem to say the same thing, but I do not understand...I think this is right:

    -To get a database into 2nd Normal Form you need to remove all functional dependencies.

    -To get a database into 3rd Normal Form you need to remove all transitive dependencies.

    Hopefully I have understood this correct!?!? But the thing is, I understand the concept of this, but I do not understand how to actually apply this...and I have searched and searched on the Internet for just a simple beginners guide to this...and it is driving me mad on how complex some 'simple' guides are??

    There was an example given today, which was this...

    If we know this:

    Relation Name: Contacts
    Attributes: Name, Room, Telephone, email
    Dependencies: Name -> Telephone
    Room -> Telephone
    Name -> email

    Turn this into 3rd Normal Form. I cannot do this to save my life for some reason...I cannot understand how to know what the functional dependencies are??

    I mean, from this i can gather that Name -> Telephone, Email, and that Room -> Telephone, but which ones are partially dependent and how do you tell?

    If anyone can please PLEASE explain and talk me through this and give a simple guideline on how to turn a table into a 2NF, given a set of dependencies I will be forever grateful!

    Thanks you in advance guys, most appreciated!

    Ben

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try http://r937.com/relational.html

    note that room does not necessarily determine telephone

    it might've, back in the day, when all there was was land lines

    but i would venture that a person's contact information might include a cell phone today

    as for your question about 2NF, if you don't have a composite primary key, then as long as you don't have any column containing multiple values (like a comma-delimited list), then you're automatically in 2NF
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2008
    Posts
    4
    Thank you for the reply, I shall read through that website now for some advice and help on the subject!

    I think this was a bad example, there are a couple more that were given today....

    Could you please help me identify the "Partial Dependencies"...this is what I cant really seem to do, I now kind of understand what to do, it's just identifying the partial dependencies that i cant do...can someone please talk me through identifying them in this example:

    R1
    a, b, c, d, e, f, g, h
    a -> b
    a -> c
    d -> e
    a -> f
    d -> f
    f -> g
    e -> h

    Which ones are partially dependent and why??
    How would you organize this into 2nd Normal Form??

    Thank you once again

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sorry, i don't do partial functional dependencies, or academic exercises, either

    i just build tables

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Nov 2008
    Posts
    4
    lol...if anyone out there can help me PLEASEEE help lol

    That website link you gave me is awesome and explains it in simple terms, thank you very much!

    I think, thinkkk that this is the solution to the above problem...

    table 1:
    (PK) A
    B
    C

    table 2:
    (PK) D
    E

    table 3:
    (PK) A
    (PK) D
    F
    G

    If anyone out there can tell me this is correct or where i've gone wrong, much appreciated!

    Cheers

  6. #6
    Join Date
    Nov 2008
    Posts
    4
    Wow in all seriousness I have spent quite a while tryin to get in terms with all of this, and after reading that simple website, I think I am starting to understand it....well when someone replies to my thread if i am right or not it would be a great help to see if i have understood it....

    The only thing for me now is....

    What on earth do you do for an example like this!?!?

    R1
    a, b, c
    a -> c
    b -> c
    c -> a
    c -> b


    Do you simply do:

    Table 1:
    (PK) A
    C

    Table 2:
    (FK) A
    (PK) B
    C

    This is a confusing one, if I have got the first one right, then I think this is the last obstacle to understand! Im looking forward to a reply to help to give myself peace of mind

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •