| |
|
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.
|
 |
|

03-19-07, 00:31
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 39
|
|
|
2nf
|

03-19-07, 04:10
|
|
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.
|
|
|

03-19-07, 05:01
|
|
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
|
|

03-19-07, 05:04
|
|
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.
|
|
|

03-19-07, 06:57
|
|
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?
|
|

03-19-07, 07:08
|
|
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
|
|

03-19-07, 07:26
|
|
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.
|

03-19-07, 07:49
|
|
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?
|
|

03-19-07, 10:24
|
|
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?
|
|

03-19-07, 10:38
|
|
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?
|
|

03-19-07, 17:55
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 39
|
|
2NF states that it must be in 1NF and no partial dependencies
|
|

03-19-07, 18:56
|
|
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
|
|

03-19-07, 23:18
|
|
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.
|

03-20-07, 05:22
|
|
SQL Consultant
|
|
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
|
|
good
so, which are the partial dependencies in that latest table?
|
|

03-20-07, 11:05
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 39
|
|
the partial dependencies are name and time
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|