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 > 2nf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-19-07, 00:31
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
2nf

I am trying to understand 2NF, Is there any way to put the data below in
2NF:

http://www.mylabserver.com/226_1/arn...5_1dataImg.gif



Thank you
Reply With Quote
  #2 (permalink)  
Old 03-19-07, 04:10
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Are you sure you don't mean you have an assignment to get that to 2 NF?

What have you got so far? And what do you understand to be 2NF?
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 03-19-07, 05:01
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Quote:
Originally Posted by robasc
I am trying to understand 2NF, Is there any way to put the data below in
2NF:
probably the first thing you should do is put that data into 1NF

only after it's in 1NF, then you can start thinking about 2NF
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 03-19-07, 05:04
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Aw.... you spoiled my next post
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #5 (permalink)  
Old 03-19-07, 06:57
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
I do understand 1NF, and I see that project and time has produced repeating groups and therefore violates 1NF.

But I do not see how to put this in second normal form:

I do know that emp_id is good enough to determine name and time

emp_id => name, time

but what would project determine or can project be by itself?

I am not really shure I understand 2NF yet?
Reply With Quote
  #6 (permalink)  
Old 03-19-07, 07:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
if you understand 1NF, could we see your 1NF design please?

yes, project can be by itself, just like employee can be by itself
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 03-19-07, 07:26
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
Here is 1NF:
Code:
EMP_ID    NAME               PROJ_NUM    TIME

ENI-26    SEAN O' BRIAN      30-452-T3    .25
ENI-26    SEAN O' BRIAN      30-457-T3    .40
ENI-26    SEAN O' BRIAN      32-244-T3    .30
ENI-33    AMY GUYE           30-452-T3    .05
ENI-33    AMY GUYE           30-382-TC    .35
ENI-33    AMY GUYE           32-244-T3    .60
ENI-35    STEVE BARANCO      30-452-T3    .15
ENI-35    STEVE BARANCO      31-238-TC    .80
ENI-36    ELIZABETH ROSLYN   35-152-TC    .90
ENI-38    CAROL SHAAF        36-272-TC    .75
ENI-40    ALEX WING          31-238-TC    .20
ENI-40    ALEX WING          31-241-TC    .70

Last edited by r937; 03-19-07 at 07:47.
Reply With Quote
  #8 (permalink)  
Old 03-19-07, 07:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
excellent

i hope you don't mind, i edited your post to format the display

okay, now, let's think about what 2NF would mean for this table

first of all, what would the PK for this table be?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #9 (permalink)  
Old 03-19-07, 10:24
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
Thanks for editing the code,

the primary key's would be EMP_ID and PROJECT since project seems to uniquely identify each one.

is this correct?
Reply With Quote
  #10 (permalink)  
Old 03-19-07, 10:38
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
yes, EMP_ID and PROJ_NUM would be a candidate key

another would be NAME and PROJ_NUM

another would be EMP_ID and NAME and PROJ_NUM

what is the definition of 2NF?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #11 (permalink)  
Old 03-19-07, 17:55
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
2NF states that it must be in 1NF and no partial dependencies
Reply With Quote
  #12 (permalink)  
Old 03-19-07, 18:56
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
okay, good

could you please explain what a partial dependency is -- try to use your last table as the example
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #13 (permalink)  
Old 03-19-07, 23:18
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
it's a dependency that is partially dependent on the primary key

Last edited by robasc; 03-19-07 at 23:58.
Reply With Quote
  #14 (permalink)  
Old 03-20-07, 05:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
good

so, which are the partial dependencies in that latest table?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #15 (permalink)  
Old 03-20-07, 11:05
robasc robasc is offline
Registered User
 
Join Date: Mar 2007
Posts: 39
the partial dependencies are name and time
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