In article <f96a9b830510200029p3170c159u9f096de47e9c615c@stripped>,
Jochem van Dieten <jochemd@stripped> writes:
> Back in reality you don't enforce this using DDL. Apart from the fact
> that I wouldn't know a single database that implements ASSERTIONs
> according to the SQL standard, can you imagine having to run some
> SELECT fk FROM table GROUP BY fk HAVING COUNT(fk) NOT BETWEEN x AND y
> on every commit? This is something you enforce with triggers or
> circumvent by using a stored procedure for all DML operations.
If some multiplicity is one of your business rules, it doesn't matter
if you put it into a trigger, a stored procedure, or an assertion -
you'll have to run the query above on every commit anyway.