An integrity constraint is a rule governing the permitted contents of the rows in a table. A row can only be inserted into a table (INSERT, MERGE) or deleted from a table (DELETE) and a column value can only be updated (MERGE, UPDATE) if, afterwards, all integrity constraints are satisfied.
Integrity constraints cannot be defined for multiple columns.
Integrity constraints can be defined for individual columns or for a table. A column constraint is an integrity constraint on a single column. A table constraint is an integrity constraint which can refer to more than one column in the base table.
NOT NULL constraint
The NOT NULL constraint requires that a column contain no NULL values. The NOT NULL constraint can only be specified as a column constraint.
UNIQUE constraint
The UNIQUE constraint requires that the specified column or set of columns accept only unique values or sets of values.
PRIMARY KEY constraint
The PRIMARY KEY constraint defines a column or set of columns as the primary key of a table. The PRIMARY KEY constraint requires that the column or set of columns satisfy the UNIQUE and NOT NULL constraints. A table can have a maximum of one primary key.
Check constraint
A check constraint requires that every row in a table, the search condition entered accepts the truth value true or unknown, but not, however, the truth value false.
The search condition can only reference the table for which the check constraint was defined.
Referential constraint
A referential constraint ([FOREIGN KEY]..REFERENCES) defines a column or a combination of columns as a foreign key for a table. The columns for the foreign key are assigned to one or more columns in a single table or in two tables. These columns are called the referenced columns. The UNIQUE constraint must be valid for the referenced columns. The table containing the foreign key is called the referencing table. The table to which the referenced columns belong is called the referenced table. If no columns are specified for the referenced table, the primary key of the referenced table is used.
SESAM/SQL rejects a table operation after checking the referential constraint
if, when a row is inserted or column values are updated in the referencing table, no appropriate values would exist in the referenced columns.
if, when deleting or updating rows or columns in the referenced tables, foreign key values would remain in the referencing tables for which appropriate values in the referenced columns or the corresponding column would no longer exist.
In the case of single-column foreign keys, the referential constraint requires that every nonNULL value of the foreign key for a table match a value in the referenced column.
In the case of multiple-column foreign keys, each set of values that does not include a NULL value must occur in the referenced columns. This means that in SESAM/SQL, a row satisfies the referential constraint if a NULL value occurs in at least one column of a multiple-column foreign key.