Re: Translating constraints to RM Terms

From: John <no_at_email>
Date: Mon, 06 Jun 2005 11:22:14 +0100
Message-ID: <42a423d2$0$2604$da0feed9_at_news.zen.co.uk>


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

This is straightforward, but we must use the proper terminology.

Relation X has Attributes A and B.

For every Tuple t in the body of X, the attribute value for A must be "<" the attribute value for B.

In X, the Attributes A and B are both of (in) some domain T.

You have supplied insufficient information to define T, but it is worth noting that the domain T could be anything you like as long as the comparison operator "<" is well defined with respect to that domain.


Informally then, you have tried to apply a constraint to the domains, which isn't what you wanted to do. The constraint is applied to the tuples in the relation, NOT to the domain(s).

John Received on Mon Jun 06 2005 - 12:22:14 CEST

Original text of this message