Re: Relation Schemata vs. Relation Variables
Date: 23 Aug 2006 07:15:09 -0700
Message-ID: <1156342509.211179.193040_at_b28g2000cwb.googlegroups.com>
Keith H Duggar wrote:
> Keith H Duggar wrote:
> > Brian Selzer wrote:
> > > For instance, consider the following states for a
> > > relation describing people's marital status, and a
> > > transition constraint that says: Single people can't
> > > become Divorced:
> > >
> > > Current Proposed
> > > Jane Jones Married Jane Jones Married
> > > Jane Smith Single Jane Smith Divorced
> >
> > Please express this constraint using relational calculus.
> > I'm particularly interested to see how "people" and
> > "become" are expressed.
>
> Forgive this bump, but I'm a little curious. Was my above
> question irrelevant or tangent or ignorant in some way? Are
> such constraints usually specified in relational calculus?
> Thank you in advance to anyone offering guidance.
>
No, you're question isn't irrelevant, nor tangent, nor ignorant. The problem is that I don't think that it *can* be expressed in relational calculus without making gross assumptions.
If you make the gross assumption that key values in the old state identify tuples in the new state, then
NOT (EXISTS p IN new EXISTS q IN old (q.LAST = p.LAST
AND q.FIRST = p.FIRST AND q.STATUS = 'Single' AND p.STATUS= 'Divorced'))
The problem is that transition constraints describe the changes that can occur to things in the universe and that can be recognized in the differences between tuples in the current database state and tuples in a proposed database state. Just because a candidate key value can identify a fact in the current database state doesn't always mean that it can identify one in the proposed database state, nor does it mean that the one identified is about the same thing. The definition of a candidate key limits its scope to a single dabase state. Keys can change, but that doesn't mean that the facts they determine in their respective database states don't refer to the same thing at different times.
> -- Keith -- Fraud 6
Received on Wed Aug 23 2006 - 16:15:09 CEST