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 > Hi to everybody

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-10-12, 17:57
jross1 jross1 is offline
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old 01-10-12, 18:28
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by jross1 View Post
Could somebody point me in the direction of Normalisation help
allow me ---------------> Database Concepts & Design - dBforums
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-10-12, 19:19
jross1 jross1 is offline
Registered User
 
Join Date: Jan 2012
Posts: 5
Thanks for the prompt help
Reply With Quote
  #4 (permalink)  
Old 01-10-12, 19:30
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.
Reply With Quote
  #5 (permalink)  
Old 01-10-12, 21:00
jross1 jross1 is offline
Registered User
 
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.
Reply With Quote
  #6 (permalink)  
Old 01-11-12, 13:19
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.
Reply With Quote
  #7 (permalink)  
Old 01-11-12, 13:38
jross1 jross1 is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 01-12-12, 13:03
jross1 jross1 is offline
Registered User
 
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
Hi to everybody-1nf.jpg  

Last edited by jross1; 01-15-12 at 18:12. Reason: added Image
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