Re: Union / set difference problem
From: Jan Hidders <hidders_at_uia.ua.ac.be>
Date: Wed, 28 Nov 2001 12:48:09 +0100
Message-ID: <3c04dce1$1_at_news.uia.ac.be>
> Decide if the following 2 statements are valid:
> 1) if A and B are superkeys for R then A U (B-A) is a superkey for R
Date: Wed, 28 Nov 2001 12:48:09 +0100
Message-ID: <3c04dce1$1_at_news.uia.ac.be>
Enrico Sanchez <enrico26_at_gotmail.com> wrote in message news:3c040fd8$1_3_at_mk-nntp-1.news.uk.worldonline.com...
>
> Decide if the following 2 statements are valid:
> 1) if A and B are superkeys for R then A U (B-A) is a superkey for R
Trivial. If A is a superkey then any superset of A is also a superkey. So since A u (B - A) is a superset of A it follows that it is also a superkey.
> 2) the intersection of two (distinct) superkeys for R is always a
candidate
> key for R
No. Counterexample: Take the relation R(A,B,C,D) with only one candidate key viz. A. In that case ABC and ABD are superkeys, but their intersection AB is not a candidate key.
- Jan Hidders