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 > Normalization 3NF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-18-07, 07:31
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
Normalization 3NF

Just started Database design at college, and have a assignment coming out in 3 weeks on 3NF.

We have been given this example to do. it is in unnormalized form, and we have to put it nto 1NF, then 2NF , and then finaly 3NF.

I am happy with 1NF, taking out duplicate rows columns, having only 1 piece of data in a cell, ect. But really struggling going to 2NF and then 3NF. Could sombody help me please ???

http://img329.imageshack.us/img329/3...izationvv5.jpg
Reply With Quote
  #2 (permalink)  
Old 01-18-07, 09:55
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
the way this forum works with regard to doing homework assignments is like this --

you do some work and show your results, asking specific questions about anything that you have done

we provide comments and suggestions

you go back and do some more work, and post revised results

we provide comments and suggestions

etc.

at no time will we do your assignment for you

deal?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 01-19-07, 16:46
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
kutnessworthy -
you can be one of the ones that puts in some effort:
Need help on a SQL Query
or one of those that does not:
http://www.dbforums.com/showthread.p...75#post6226875

Your choice dude\ dudette
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #4 (permalink)  
Old 01-20-07, 06:55
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
ok, sorry i get your point,

i have had a go at putting it into 1NF. I got confused with the no repeating data part , as some of the the order numbers are the same, but have diffrent part numbers.

http://img258.imageshack.us/img258/82/1nf8eu.png

am i getting this right ???
Reply With Quote
  #5 (permalink)  
Old 01-20-07, 07:29
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by kutnessworthy
...some of the the order numbers are the same, but have diffrent part numbers.
that's because a single order can have more than one item, yes? how would you feel if you went to the grocery store and were required to go through the checkout with only one item at a time?

okay, so an order can have multiple items, right?

your next challenge is to figure out which combination of column values in your 1NF table are unique, and so could be used as the primary key

obvioulsy, the order number is not unique, because it will be on multiple rows -- all the items in the order

so let me give you a hint, and suggest that order number and item number together are unique

your next step, 2NF, is to ensure that every column is dependent on the entire primary key

does the customer depend on the order number and item number together? no, because customer is dependent only on the order number

does this make sense?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 01-23-07, 13:06
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
so are you saying my 1NF is correct ???
Reply With Quote
  #7 (permalink)  
Old 01-23-07, 13:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
since each column value is atomic, yes
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #8 (permalink)  
Old 01-23-07, 13:49
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
brilliant, busy doing 2NF now.

cheers
Reply With Quote
  #9 (permalink)  
Old 01-23-07, 15:43
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
changed my 1NF table abit, split the customer and sales assistant names into First and Surnames. this correct ?

http://img408.imageshack.us/img408/2964/1nf2wh.png

now to put it into 2NF would i have to add more fields, like a Customer_ID and Sales_ID

then have 4 tables

Order No , Date.
Customer_ID,Customer Surname,Customer Firstname,Cust Phone.
Sales_ID,Sales Assit Surnname,Sales Assit Firstname,Sales Assit Phone.
Part No, Part, Qty, Price.

???
Reply With Quote
  #10 (permalink)  
Old 01-23-07, 16:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by kutnessworthy
Order No , Date.
Customer_ID,Customer Surname,Customer Firstname,Cust Phone.
Sales_ID,Sales Assit Surnname,Sales Assit Firstname,Sales Assit Phone.
Part No, Part, Qty, Price.
very close, very nice

there's a problem with the last one -- how do you relate parts to orders?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #11 (permalink)  
Old 01-23-07, 16:04
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
Quote:
Originally Posted by r937
very close, very nice

there's a problem with the last one -- how do you relate parts to orders?
put Order No with it ?
Reply With Quote
  #12 (permalink)  
Old 01-25-07, 15:35
kutnessworthy kutnessworthy is offline
Registered User
 
Join Date: Jan 2007
Posts: 24
Reply With Quote
  #13 (permalink)  
Old 01-25-07, 16:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
no, that's not quite right, but it's a real good effort

the red table is wrong

as a hint for the normalization process, make sure that you have identified at least one candidate key for every relation you build along the way

in your case, there is only one possible candidate key for each of the red, blue, and green tables

as soon as you identify what makes each row in the red table unique, you will see the error

at least, i think you should
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #14 (permalink)  
Old 01-26-07, 14:53
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
The blue table has two candidate keys.
Reply With Quote
  #15 (permalink)  
Old 01-26-07, 15:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by urquel
The blue table has two candidate keys.
no, it doesn't -- take a closer look
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
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