Re: 2NF There are two Definitions which is right
Date: Thu, 21 Jul 2005 09:40:36 +0200
Message-ID: <3k91rlFt11n8U1_at_individual.net>
Jonathan Leffler wrote:
> Can you give a hint as to the significance of the parenthesized "(A,F)";
> neither A nor F is referenced in the definition quoted. I don't think
> it alters the answer, but I'm curious. (The comma after 2NF should be
> omitted too.)
R(A,F) means a Relation R with attributes A and functional dependencies F
> Assuming 'nonprime attributes' are the attributes that do not belong to
> the primary key, it seems to me that the two definitions are the same.
A superkey of a relation schema is a set of attributes S part of R with the property that no two tuples t1 and t2 in any legal relation state r of R will have t1[S] = t2[S]. A key K is a superkey with the additional property that removal of any attribute from K will cause K not to be a superkey any more. The difference between a key and a superkey is that a key has to be minimal; that is, if we have a key K={A1,A2,....Ak} of R, then K - {Ai} is not a key of R for any i, l <= i <= k.
According to this definition there is a difference between the two definitions.
> I agree that AB is the primary key - or at least a valid primary key.
> A->D itself cannot violate 2NF; it is a functional dependency, and
> relation schemas are what satisfy or violate 2NF. And the reasoning the
> that D is not part of the primary key is bogus too.
A->D tells us that D is only dependant on A and so only on a part of the primary key.
>
> As I see it, AB->C and C->D implies that AB->D so the primary key
> determines both C and D, as required. Granted, it is neither in 3NF nor
> BCNF - the mnemonic is "the key, the whole key, and nothing but the
> key", and the functional dependency A->D means that 'the whole key' part
> of the rule is violated. (The C->D part is also problematic, but doesn't
> cause the relation schema to violate 2NF.)
According to Ullmans definition of 3NF:
it is in 3NF since:
A->D holds 3NF since D is prime attribute
AB->C holds 3NF because AB is candidate key
C->D holds 3NF because D is prime attribute
D->A holds 3NF because A is prime attribute
A relation R is in third normal form in whenever X -> A holds in R and A
is not in X, then either X is a candidate key for R, or A is prime attribute
> Now you introduce a term - candidate key - not mentioned in the
> definitions of 2NF that we're dissecting. I would dispute that BC is a
> candidate key anyway; likewise BD. Given a relation schema R { A, B, C,
> D, E } with candidate key AB, by definition, AB->CDE (and, by the rules
> of trivial functional dependencies (or FDs), AB->ABCDE). That is, a
> candidate key functionally determines every attribute in the relation
> schema. How do you apply Armstrong's Axioms to the relation schema and
> list of FDs to deduce that BC->AD?
Jens Received on Thu Jul 21 2005 - 09:40:36 CEST
