Re: thinking about UPDATE

From: D Guntermann <guntermann_at_hotmail.com>
Date: Thu, 22 Jul 2004 23:50:50 GMT
Message-ID: <I1A28s.BGM_at_news.boeing.com>


"Jan Hidders" <jan.hidders_at_REMOVETHIS.pandora.be> wrote in message news: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.

OK. But what if we started with relation R = subset of Cartesian product of domains {d1,d2}?
If the empty set has its own implied domain (d0), then we would define R as the cartesian product: d0 X d1 X d2.

((d0 X d1) X d2) = (({} X d1) X d2) = {} X d2 = {}.

The subset of any empty set will be the empty set. Any relation will be, by definition, an empty set of tuples.

Since we can construct relations that are not empty sets, we can conclude that the empty set is not part of the superkey of any relation that is a subset (not proper) of relation R's attributes.

>
> 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.

OK. following along. t[K] = { (d1, 1), (d1, 2), (d2,1), (d2, 2) | 1 is element of d1, d2 and 2 is element of d1, d2}. If there were an implied empty set here, then what would be substituted for the variable attribute a? Do we need to add ({},{})?

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

From this point, I think I understand, but it still conflicts with my definition of a relation given above.
>
> So what does this mean if K = {}? Since {} has no proper subsets this is
> equivalent with the fact that it is a superkey.

So, the fact that be statement " {}has no proper subsets" is a vacuously true statement has no bearing?

 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.
>
Yes. Thank you. I still have problems reconciling the definition of a relation with the empty set independent of the definition of candidate keys, though.
.
> Hope that helps.

It does...
>
> -- Jan Hidders
Received on Fri Jul 23 2004 - 01:50:50 CEST

Original text of this message