Re: Do values have constraints?

From: Bob Badour <bbadour_at_golden.net>
Date: Fri, 5 Sep 2003 11:55:40 -0400
Message-ID: <3x36b.549$hG7.51871761_at_mantis.golden.net>


"Paul Vernon" <paul.vernon_at_ukk.ibmm.comm> wrote in message news:bja7q9$n38$1_at_gazette.almaden.ibm.com...
> "Bob Badour" <bbadour_at_golden.net> wrote in message
> news:KmP5b.506$ad6.48870536_at_mantis.golden.net...
> [snip]
> > > But as I said, I don't believe that type inheritance needs to be
defined
> > > separately for relations. See IM Prescription 25: Tuple/relation
Variables
> > > with Inheritance for more details.
> > >
> > > Constaints are not part of the type specficition of relations and
tuples.
> >
> > Obviously, I think they are regardless of any artificial distinction. Do
you
> > have a reason for thinking the distinction is necessary?
>
> What about foreign key and other database constraints.

Ahhh, now we move beyond the realm of relation types to the realm of database types.

> if attribute F in relvar A(F INTEGER) is a foreign key from relvar B(F
INTEGER), what
> is the type of relvar A? How do we reference relvar B in the type
definition of A?
> Should type definitions be dependent on the existence of variables? Do
the valid
> values of the type of relvar A change depending on the contents of relvar
B?

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.

We can also observe that attribute G might have a foreign key reference to B or to some other named relation variable, and again this would affect only the type of the database variable.

One might argue that some types are named and some anonymous so that we should only consider named types, but most relation types are anonymous. Received on Fri Sep 05 2003 - 17:55:40 CEST

Original text of this message