More Complex Constraints...
…Among several attributes in one table
- Specify at the end of CREATE TABLE
CHECK (gender = ‘F’ OR name NOT LIKE ‘Ms.%’)
Checked whenever a tuple of the relation is added or updated.
Note, changes in other places in the database may cause the constraint to be violated. If this is important, use assertions.