Re: Translating constraints to RM Terms

From: Kenneth Downs <knode.wants.this_at_see.sigblock>
Date: Tue, 07 Jun 2005 10:28:22 -0400
Message-Id: <glngn2-do8.ln1_at_pluto.downsfam.net>


mAsterdam wrote:

> Kenneth Downs wrote:
> 

>> I'm wondering if some RM theorist might express something for me.
>>
>> Consider table X with columns A and B. There is a constraint that A must
>> be
>> less than B. While we discuss such constraints every day, I realize I do
>> not know how to express such constraints in relational terms.
>>
>> For instance, A is actually a domain, as is B, but the constraint A < B
>> must in fact be part of the very definition of the domain A, and here we
>> are
>> defining one domain in terms of another. I realized I have not seen this
>> disccussed in the year or so I have been a regular here. Is defining one
>> domain in terms of another allowed and considered trivial, no big deal?
>> Is it actually not allowed and this is some SQL alteration of true RM?
> 
> The constraint 'A < B' suggests to me that there is
> 'something' of A in B or the other way round. In this
> case it is easy to engage some isolation.
> The base table (say W) should just contain A and C, C being a positive
> number. X becomes a view with A = W.A and B = W.A + W.C
> 
> That this isolation is possible in this example
> should not be taken to mean that it is in all cases
> you have in mind, though.
> 
> My 2 Eurocents.

So are you suggesting the possibility that if A is contrained by B, then it is possible that B can be determined by A or by other column values? This would be exciting if it could be demonstrated in the general case.

But it does not seem to apply generally. Consider the case of credit limit and customer exposure. Credit limit is a normal column in the customer table. Exposure equals sum of open orders and invoices, and exposure may not exceed credit limit. Notwithstanding whether or not we materialize the column "exposure", it is defined as an attribute of the customer.

-- 
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth_at_(Sec)ure(Dat)a(.com)
Received on Tue Jun 07 2005 - 16:28:22 CEST

Original text of this message