|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:48 PM
Points: 7,088,
Visits: 7,143
|
|
olsonea (7/28/2011) When I was studying Relational Database Concepts in college, there was a catchy mnemonic for 3NF: "The key, the whole key, and nothing but the key, so help me Codd." It's a good catch phrase. Been around a long long time.
Did they tell you that: 1NF = The key 2NF = The whole key 3NF = Nothing but the key ?
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 6:10 AM
Points: 1,322,
Visits: 1,070
|
|
The difference between 2NF and 3NF is that 2NF does not permit any non-prime attribute to have a dependency on something which is a proper subset of a candidate key, while in 3NF a non-prime attribute may not depend on anything which is not a superkey My confusion is that the original table in the example is, then, not in 2NF because the phone number depends on something (Group) that is not the whole key, or in fact, even part of the key. So it seems that you took a table from 1NF to 2NF which was then trivially in 3NF (in the sense that no extra work was required to get it into 3NF).
What I would like to see is a table that is in 2NF converted into 3NF. -- JimFive
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:48 PM
Points: 7,088,
Visits: 7,143
|
|
James Goodwin (7/28/2011)
The difference between 2NF and 3NF is that 2NF does not permit any non-prime attribute to have a dependency on something which is a proper subset of a candidate key, while in 3NF a non-prime attribute may not depend on anything which is not a superkey My confusion is that the original table in the example is, then, not in 2NF because the phone number depends on something (Group) that is not the whole key, or in fact, even part of the key. So it seems that you took a table from 1NF to 2NF which was then trivially in 3NF (in the sense that no extra work was required to get it into 3NF). What I would like to see is a table that is in 2NF converted into 3NF. -- JimFive Ah, a confusion about 2NF. You hit the crucial point when you said "or [not] in fact, even part of [the key]", because that is of course allowed by 2NF. There's nothing in 2NF to stop an attribute being dependent on some set of attributes that includes something that isn't part of a key. The rule is that if a non-prime attribute is dependent on something that is a subset of a key that subset must be the whole key. Or putting it another way, the whole key is not the only thing it can be dependent on, the rule is simply that it must never be dependent on a partial key. So the original table inthe 3NF article is indeed in 2NF.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 4:21 PM
Points: 171,
Visits: 1,399
|
|
Thanks for the articles Tom. I am really enjoying them; your examples are nice and clear. I am looking forward to the rest!
Cheers,
Nicole Bowman
Nothing is forever.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 4:52 PM
Points: 1,379,
Visits: 2,626
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 7:55 PM
Points: 7,
Visits: 193
|
|
Hi Tom,
I was also confused about whether the 3NF example was in 2NF or not.
I had just submitted a really long question, but then saw your reply to James:
There's nothing in 2NF to stop an attribute being dependent on some set of attributes that includes something that isn't part of a key. The rule is that if a non-prime attribute is dependent on something that is a subset of a key that subset must be the whole key. Or putting it another way, the whole key is not the only thing it can be dependent on, the rule is simply that it must never be dependent on a partial key.
This is a great summary, and IMO would be a good addition to the 2NF article.
Thanks, John
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:48 PM
Points: 7,088,
Visits: 7,143
|
|
john.rees-894283 (7/28/2011)
Hi Tom, I was also confused about whether the 3NF example was in 2NF or not. I had just submitted a really long question, but then saw your reply to James: There's nothing in 2NF to stop an attribute being dependent on some set of attributes that includes something that isn't part of a key. The rule is that if a non-prime attribute is dependent on something that is a subset of a key that subset must be the whole key. Or putting it another way, the whole key is not the only thing it can be dependent on, the rule is simply that it must never be dependent on a partial key.
This is a great summary, and IMO would be a good addition to the 2NF article. Thanks, John Hi John,
Thanks for your input.
This is one of those times where I wish I had had people's comments before I published the 2NF article! It's not the first time, if you look at the comments you'll see that I needed a revision after one of the first few comments.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:48 PM
Points: 7,088,
Visits: 7,143
|
|
dogramone (7/28/2011) Thanks for these articles Tom. I have ensure the application developers here are reading all of them. Of course the DBA's already get it but like a lot of small shops the DBAs don't do development and although there are a lot of senior developers they are all building to a OLTP style and are always making these common mistakes.
I'm anxiously looking forward to the next in the series and the Fourth and Fifth are for me as I've only ever gotten to 3.5 or what I was taught as Boyce Codd Normal Form. Thanks for the encouragement; it's good to know that my attempts are appreciated.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 6:10 AM
Points: 1,322,
Visits: 1,070
|
|
Tom, Much clearer. Thanks for the response. -- JimFive
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, February 05, 2013 7:23 AM
Points: 2,
Visits: 38
|
|
Tom.Thomson (7/28/2011)
James Goodwin (7/28/2011)
The difference between 2NF and 3NF is that 2NF does not permit any non-prime attribute to have a dependency on something which is a proper subset of a candidate key, while in 3NF a non-prime attribute may not depend on anything which is not a superkey My confusion is that the original table in the example is, then, not in 2NF because the phone number depends on something (Group) that is not the whole key, or in fact, even part of the key. So it seems that you took a table from 1NF to 2NF which was then trivially in 3NF (in the sense that no extra work was required to get it into 3NF). What I would like to see is a table that is in 2NF converted into 3NF. -- JimFive Ah, a confusion about 2NF. You hit the crucial point when you said "or [not] in fact, even part of [the key]", because that is of course allowed by 2NF. There's nothing in 2NF to stop an attribute being dependent on some set of attributes that includes something that isn't part of a key. The rule is that if a non-prime attribute is dependent on something that is a subset of a key that subset must be the whole key. Or putting it another way, the whole key is not the only thing it can be dependent on, the rule is simply that it must never be dependent on a partial key. So the original table inthe 3NF article is indeed in 2NF.
|
|
|
|