
If SQL Server is the target DBMS, each of these constraints is mapped to a stored
procedure, which you can view in the Code Editor. The constraint code generated
(minus comments) is as follows.
Create Procedure sp_Parenthood_freq1 as
if (not exists (select
*
from “Parenthood”
group by “Parenthood”.”childld”
having count(
*
) > 2))
return 1
else return 2
Create Procedure sp_Parenthood_ring2 as
if (not exists (select
*
from “Parenthood” X, “Parenthood” Y
where X.”parentld” = Y.”childld” and X.”childld” = Y.”parentld”)
and
not exists (select
*
from “Parenthood” X, “Parenthood” Y, “Parenthood” Z
where X.”childld” = Y.”parentld” and Y.”childld” = Z.”childld”
and X.”parentld” ...