When you use the multiple-column constraint format, you cannot define any default values for columns. In addition, you cannot establish a referential relationship between two columns of the same table.
To define a default value for a column or establish a referential relationship between two columns of the same table, refer to Single-Column Constraint Format and Referential Relationships Within a Table respectively.
You cannot place unique, primary-key, or referential (FOREIGN KEY) constraints on BYTE or TEXT columns. You can, however, check for NULL or non-NULL values with a check constraint.
You cannot place unique or primary-key constraints on BLOB or CLOB columns.
You can find detailed discussions of specific constraints in the following sections:
Constraint | For more information, see | For an example, see |
---|---|---|
CHECK | CHECK Clause | Defining Check Constraints Across Columns |
DISTINCT | Using the UNIQUE or DISTINCT Constraints | Examples of the Multiple-Column Constraint Format |
FOREIGN KEY | Using the FOREIGN KEY Constraint | Defining Composite Primary and Foreign Keys |
PRIMARY KEY | Using the PRIMARY KEY Constraint | Defining Composite Primary and Foreign Keys |
UNIQUE | Using the UNIQUE or DISTINCT Constraints | Examples of the Multiple-Column Constraint Format |