Re: What are the differences between the terms, CANDIDATE KEY, PRIMARY KEY, SUPER KEY, COMPOSITE KEY?

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 24 Feb 2006 12:20:36 -0800
Message-ID: <1140812436.783278.188800_at_i39g2000cwa.googlegroups.com>


Mikito Harakiri wrote:
> Marshall Spight wrote:
> > Mikito Harakiri wrote:
> > >
> > > There is no formal distinction between them. Therefore, let's speak of
> > > unique key or just a key. Formally, a key is a functional dependence
> > > from a set of attributes to the whole relation header.
> >
> > This is nice and simple, but it slightly bothers me that in most cases,
> > this describes an FD that has attributes on both the left and right
> > side of the arrow. (Not that there is anything wrong with that, but
> > perhaps there is some value to excluding the trivial depedencies?)
>
> I think you have it backwards. A trivial FD is
>
> header -> any set of attributes
>
> not
>
> a set of attributes -> header

As I understand it, an FD X -> Y is formally called trivial if Y is a subset
of X. (So your example header -> set of attributes certainly qualifies.)

But it strikes me that there is an air of triviality in any FD where some specific attribute appears both on the left side *and* on the right side. We can apply decomposation to AB->BC and get

  1. AB->B
  2. AB->C
  3. is trivial. AB->BC doesn't say anything that isn't said by AB->C.

So if we describe a key as being an FD X->Y, where Y is the header, then we necessarily (unless X is empty) have attributes that appear in both X and Y. It strikes me that this could be reduced by replacing Y with (header - X).

But I am making only a tiny point, useful only for establishing a canonical form of a key, and not for establishing any properties of keys or FDs.

Marshall Received on Fri Feb 24 2006 - 21:20:36 CET

Original text of this message