Re: Do values have constraints?

From: Paul Vernon <paul.vernon_at_ukk.ibmm.comm>
Date: Fri, 5 Sep 2003 17:31:07 +0100
Message-ID: <bjadto$19vm$1_at_gazette.almaden.ibm.com>


"Bob Badour" <bbadour_at_golden.net> wrote in message news:3x36b.549$hG7.51871761_at_mantis.golden.net... [snip]
> > What about foreign key and other database constraints.
>
> Ahhh, now we move beyond the realm of relation types to the realm of
> database types.
[snip]
> I think it makes sense to look at a different example and then work outward.
> If we have a relvar A with two attributes F and G, we might have a
> constraint that F < G. This constraint does not affect the type of either F
> or G, but it does affect the type of A. Likewise, if F and G were relation
> valued attributes, we might have a constraint establishing a foreign key
> constraint between the relations in those attributes. Again, this constraint
> would affect the type of A but not the type of F or G.
>
> If we take a step back and observe that A has a foreign key reference from
> B, then the foreign key does not affect the type of A or the type of B, but
> it does affect the type of the database variable that represents A and B.

OK, so database constraints alter the type of the database variable. Relation constraints alter the type of relation variables (and so the database variable also)
Attribute constraints alter the type of attributes (and so their relation variable and the database variable also)

Is that correct?

Next is constraint inference on values the only point to all this, or are there other benefits in regarding constraints to be part of declared relation types?

BTW I'm a looong way from buying all of this, but lets see where it leads. :-)

Regards
Paul Vernon
Business Intelligence, IBM Global Services Received on Fri Sep 05 2003 - 18:31:07 CEST

Original text of this message