Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS

From: Gene Wirchenko <genew_at_mail.ocis.net>
Date: Tue, 19 Oct 2004 08:36:46 -0700
Message-ID: <mvcan052jhu0k8qn8hptccrss35dodfu30_at_4ax.com>


"Tony Andrews" <andrewst_at_onetel.com> wrote:

>Laconic2 wrote:
>> Tony,
>> Maybe you can help me out here.
>>
>> A lot of the current discussion seems to be turning on the issue of
>> constraints, and basically
>> whether you express them as DDL, or as metadata, or as code that
>enforces
>> them.
>>
>> But it's my impression that in the "ultimate normal form", all of
>the
>> constraints follow from the definitions of the keys and of the
>domains. So,

     Not that I can see.

>> isn't it the case that all the constraints like "person must be 18
>years or
>> older on start date" could be subsumed into the definition of the
>keys and
>> the domains?

     That requires two values: the employee birthdate and the start date. The validation is on the the dates, not just one of them.

>> Where am I going wrong here?
>
>I am not sure, but I certainly don't think all rules follow from domain
>and key definitions. Domains enforce some static rules ("salary must
>be a number between 0 and 1000000" for example), but not rules that
>require knowledge of other data (e.g. "employee salary cannot exceed
>manager's salary"). Foreign key constraints implement a subset of
>possible multi-table rules, e.g. "employee.deptno must correspond to a
>department.deptno", but not all conceivable constraints, e.g.
>"employee.deptno must correspond to a department.deptno where
>employee.hiredate between department.open_date and
>department.close_date".

     All employees for a new department must be newly-hired?

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:

     I have preferences.
     You have biases.
     He/She has prejudices.
Received on Tue Oct 19 2004 - 17:36:46 CEST

Original text of this message