Results 1 to 8 of 8

Thread: Hi to everybody

  1. #1
    Join Date
    Jan 2012
    Posts
    5

    Hi to everybody

    I just want to say Hi to everybody here before I start with the Questions

    Could somebody point me in the direction of Normalisation help especially I was wondering can i use a surrogate key and simple key as a composite key there is no real primary key I can use so I used the surrogate key but also want to add another identifier. I hope that makes at least a little sense.

    Another Idea could I use a High Score as a primary key it always has to be higher than the last score sort of like a composite of.

    GameHighScore(
    Member PK*
    Game Ref PK
    Game Details
    Date
    Score PK
    Staff Id
    Staff Name)

    thanks and if this was an entity in 2NF would i just break off the staff ID and Game Ref into new tables.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by jross1 View Post
    Could somebody point me in the direction of Normalisation help
    allow me ---------------> Database Concepts & Design - dBforums
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2012
    Posts
    5
    Thanks for the prompt help

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    I moved the whole thread to the Database Concepts forum.

    I always recommend that people start with the Rettig poster when they are trying to understand relational database normalization.

    Look it over, then come back with specific questions and we can help!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jan 2012
    Posts
    5
    Thanks Pat that was actually better than most articles I have read and I have researched a lot.

    Can I ask, if the puppies UNF would have had say a handler's attributes would these have been split off into a separate entity in 1NF, I read some articles that say " repeated data is moved to a separate entity and others related data" or are they just the same thing.

    ps. also can anybody look over my question about using the high score as part of the primary key if possible.

    Thanks.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Using the high score as part of the key could be valid, depending on how you logically perceive the table. The PK (primary key) must uniquely identify every row in the table.

    Ideally, the PK should be as small as possible... The smallest number of fields that uniquely identify a row are called the Minimal Key. While you can add any additional field you like to a Minimal Key to create Super Key, the extra information you add to the minimal key is just extra baggage and will almost certainly hurt you in the future.

    If the only thing you care about is the highest score for a given machine, then the machine itself makes a fine Minimal Key. If you need a history of high scores for each machine, then the machine and the high score form a Minimal Key.

    In regard to your question about the puppies and handlers, the handler information would probably split off in either 3NF or maybe 2NF (depending on how you look at that information).

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  7. #7
    Join Date
    Jan 2012
    Posts
    5
    Thanks I was taught to split the repeating data off into a seperate table but that was basic tables then after research noticed the split all related data into seperate tables at 1NF.

    the high score is a member plays a game and if he gets a new high score that is recorded by a member of staff, my initial thought was Mem Ref and Game Ref but then what if they played the same game on the same day with 2 high scores then it was add a surrogate key and pair it with Mem Ref.

    I normally end up putting to much effort into things and overcomplicating them.

  8. #8
    Join Date
    Jan 2012
    Posts
    5
    Ok I have put this data into what I hope is 1NF if anybody could just give me a few pointers if I am totally wrong.
    in 1NF there are 3 entitys Machines, Software and bookings, machines is the only non repeating group so I will leave that and I needed to make a table to join Machines and Software.


    Thanks for the help as it is confusing me the more I read.
    Attached Thumbnails Attached Thumbnails 1NF.jpg  
    Last edited by jross1; 01-15-12 at 19:12. Reason: added Image

Posting Permissions

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