Re: Find Candiate Keys - is there a short cut?

From: mAsterdam <mAsterdam_at_vrijdag.org>
Date: Sun, 04 Mar 2007 02:50:52 +0100
Message-ID: <45ea255e$0$335$e4fe514c_at_news.xs4all.nl>


Mike M wrote:

> Hi,
>
> ... find ALL candidate
> keys (CK) for a relation and its FDs, w/o using kind of "brute force"
> mechanism and trying whether a certain attribute (or composites of
> attributes) is CK?
>
> Eg, if there is a relation R=ABCDEFG with following dependencies:
> F={AB-->CD, DE-->AB, AC-->F, BF-->EG, E-->C, G-->H, H-->BF}
>
> I found {A,B}, {A,G}, [A,H}, {D,E}, {D,G}, {D,H}, and {B,D,F} as CKs.
> I used brute force taktic to get them, but it took me quite a while -
> and if I don't want to go through all possibilities of composed
> attributes of R, I'm not even sure whether this list is exhaustive (to
> my knowledge...).
>
> Sure, finding eg CK {A,B} eliminates other possibilities containing A
> and B. Still, it just seems not to be the best way. Is there any
> other?

This is (reformulated) a nice prolog problem. Do not ask it at c.l.p until you at least toyed with http://moonbase.wwc.edu/~aabyan/415/Normal.html Received on Sun Mar 04 2007 - 02:50:52 CET

Original text of this message