Example of NOT EXISTS Operator - SQL
Example is a translation into SQL of the corresponding example, which is included there merely to show that for any scalar comparison there is an alternative formulation using IS_EMPTY.
Example: MAX_ENROLMENTS expressed using an invocation of NOT EXISTS
CREATE ASSERTION MAX_ENROLMENTS_alternative1
CHECK (NOT EXISTS (SELECT *
FROM (VALUES (SELECT COUNT (*)
FROM IS_ENROLLED_ON)) AS
WHERE V.N > 20000));