Re: Database wide constraint?
Date: 9 Aug 2006 01:28:38 -0700
Message-ID: <1155112118.927583.232230_at_b28g2000cwb.googlegroups.com>
Emily Jones wrote:
> I have table 1, whose primary key may be used in table 2 table 3 .... table
> n, as a foreign key.
>
> Is there any constraint that can applied, hopefully once and in one place,
> that ensures that for any particular row in table 1, it's value is used in
> only one other table (though it may be used many times in that one other
> table)?
>
> Thanks, Emily
The union of all possible intersections of (the projection of) two of these tables (over this foreign key) must be empty.
That is most certainly expressible in the relational algebra. And most certainly "only once and in one place for the entire database".
Whether it is easily expressible in SQL is another question, and whether some particular sql dbms is able to enforce such a constraint, is yet another one. Received on Wed Aug 09 2006 - 10:28:38 CEST