| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: No exceptions?
Jonathan Leffler wrote:
> J M Davitt wrote:
>
>> Maybe a fine point, but... >> >> All the attributes in a relation comprise, at least, a superkey. The >> set of attributes that qualify as a candidate key must hold unique >> values and no subset of those attributes must hold unique values. The >> only relations that could have empty candidate keys are those with >> empty headings, right? (I remember puzzling this when I first >> encountered DEE and DUM.) If the heading is not empty, must a >> non-empty subset of those attributes be declared as a key?
Thanks, Jonathan; this is useful. From it I understand that the way to ensure that a relvar is a singleton is to declare an empty key
VAR singleton RELATION { ... } KEY {}
and the fragment declaring the constraint would look like:
FOREIGN KEY {} REFERENCES singleton
Jon Heggland wrote:
> There is some confusion here on both parts, I think. Any relvar can > have an empty key, regardless of the number of attributes in the > relvar. It follows that such a relvar can have no other keys. A > relvar has a set of (candidate, if you will, but I consider that > term meaningless) keys, in general, but this set cannot be empty > ---there is always at least one key.
I understand your point about candidate keys; I believe the term is used to distinguish the irreducible set of attributes that hold unique values from the sets of values that comprise superkeys.
The rest of your post confuses me. I understand that the last sentence refers to a set of keys, but I'm not sure how it is that there is only one key in that set of keys if that key's set of attributes is empty. It seems to me that every attribute would be a key and every combination of attributes would be a superkey. I don't see how an empty attribute key precludes other keys. Received on Fri Jun 30 2006 - 08:35:40 CDT
![]() |
![]() |