Re: 2nd Normal Form Question

From: David Portas <REMOVE_BEFORE_REPLYING_dportas_at_acm.org>
Date: Fri, 8 Feb 2008 20:08:33 -0000
Message-ID: <XpidnSCVHapfKzHaRVnyjgA_at_giganews.com>


"Jan Hidders" <hidders_at_gmail.com> wrote in message news:3c0c26bc-65d3-44b8-bf91-ea32c0b4a917_at_i7g2000prf.googlegroups.com...
> On 8 feb, 17:39, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>> gamehack wrote:
>> > Hi all,
>>
>> > I'm currently evaluating whether a relation is in 2NF. The relation is
>> > defined as follows:
>> > <Year | Winner Name | Winner Votes | Party | Home State> in the
>> > context of an election. I've given a sample relation below.
>> > 1946 | MyName | 453 | MyParty | California
>> > The primary key for this relation is 'Year'.
>>
>> > Now the question is whether this relation is in 2NF? What confuses me
>> > is that some books say the following:
>> > "Note that when a 1NF table has no composite candidate keys (candidate
>> > keys consisting of more than one attribute), the table is
>> > automatically in 2NF."
>>
>> I am not sure where you read that. It sounds like a typo or a mistake.
>> Composite keys are important at the higher normal forms.
>
> Of course, but all that it says is that if you have determined all the
> candidate keys and they happen all to be not-composite then a 1NF is
> always also in 2NF. I'm sure you agree that this is correct.
>
> -- Jan Hidders

Here's a counter example. PatientId is the candidate key but the relation is not in 2NF. This is an unusual case but I don't think it should be ignored.

Pregnancies {PatientId, Gender, DueDate}

FDs:
{PatientId} -> {DueDate}
{} -> {Gender}

-- 
David Portas
Received on Fri Feb 08 2008 - 21:08:33 CET

Original text of this message