Re: No exceptions?

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Fri, 30 Jun 2006 06:35:39 GMT
Message-ID: <%C3pg.319$PE1.172_at_newsread2.news.pas.earthlink.net>


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?

No. A relation can have an empty set as its primary key, in which case that relation is constrained to have at most one row of data. This table might be the configuration data for an application, for example, containing the one-off constants that parameterize its behaviour. Things like the corporation name, US federal tax ID number, state of registration, etc.

Further, any other relation could reference the configuration data relation via a foreign key with an on delete cascade action. In that case, if you ever deleted the configuration data record, all the other tables (that reference it) in the database would be emptied - automatically.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/
Received on Fri Jun 30 2006 - 08:35:39 CEST

Original text of this message