Re: thinking about UPDATE

From: Jan Hidders <jan.hidders_at_REMOVETHIS.pandora.be>
Date: Thu, 22 Jul 2004 22:20:31 GMT
Message-Id: <pan.2004.07.22.22.21.18.192211_at_REMOVETHIS.pandora.be>


On Thu, 22 Jul 2004 21:21:30 +0000, D Guntermann wrote:
>
> Given my understanding, how would you ever define a relation with
> attributes that has a key with zero attributes (an empty set), except in
> the case where one has defined a relation with zero attributes (versus
> the key). Is this what you meant?

It's just a matter of following the formal definitions right until the bitter end. Here goes:

A *superkey* is a set of attributes K such that for all two tuples t1 and t2 in the relation it holds if t1[K] = t2[K] then t1 = 2.

We let t[K] denote the projection of the tuple on the set K. For good measure we can define it formally: t[K] = { (a, v) in t | a in K }. Note that a tuple is a partial function from attributes to values.

A *candidate key* is a superkey such that no proper subset is also a superkey.

So what does this mean if K = {}? Since {} has no proper subsets this is equivalent with the fact that it is a superkey. The definition of superkey gives us the following:

  For all two tuples t1 and t2 in the relation it holds that if t1[{}] =   t2[{}] then t1 = t2.

But what is t1[{}]? This is always (regardless of t1) the empty tuple (which is here represented by the empty set). That implies that t1[{}] = t2[{}] is always true and hence we get:

  For all two tuples t1 and t2 in the relation it holds that t1 = t2.

And now you see what it means; there can be at most one tuple in the relation.

Hope that helps.

  • Jan Hidders
Received on Fri Jul 23 2004 - 00:20:31 CEST

Original text of this message