Re: Relation Schemata vs. Relation Variables

From: David Portas <REMOVE_BEFORE_REPLYING_dportas_at_acm.org>
Date: 21 Aug 2006 05:17:02 -0700
Message-ID: <1156162622.699632.139930_at_h48g2000cwc.googlegroups.com>


Erwin wrote:
> >
> > I think a transition constraint must be defined as a relational
> > expression in the general form of some join between t and t'.
> >
>
> "Suppliers with status 20 cannot be deleted."
>
> I think this is indeed an example of a transition constraint. Can this
> be expressed using just JOIN ?

In SQL (assume SupplierId is the key):

NOT EXISTS
 (SELECT SupplierId
  FROM Suppliers /* before */
  WHERE Status = 20
 EXCEPT
 SELECT SupplierId
  FROM Suppliers' /* after */) ;

-- 
David Portas
Received on Mon Aug 21 2006 - 14:17:02 CEST

Original text of this message