Optional Attributes
From InterBase
You have the option to specify:
- A default value for the column.
- Integrity constraints. Constraints can be applied to a set of columns (a table-level constraint), or to a single column (a column-level constraint). Integrity constraints include:
- The
PRIMARY KEY
column constraint, if the column is aPRIMARY KEY
, and thePRIMARY KEY
constraint is not defined at the table level. Creating aPRIMARY KEY
requires exclusive database access. - The
UNIQUE
constraint, if the column is not aPRIMARY KEY
, but should still disallow duplicate andNULL
values. - The
FOREIGN KEY
constraint, if the column references aPRIMARY KEY
in another table. Creating aFOREIGN KEY
requires exclusive database access. The foreign key constraint includes theON UPDATE
andON DELETE
mechanisms for specifying what happens to the foreign key when the primary key is updated (cascading referential integrity).
- The
- A
NOT NULL
attribute does not allowNULL
values. This attribute is required if the column is aPRIMARY KEY
orUNIQUE
key. - A
CHECK
constraint for the column. ACHECK
constraint enforces a condition that must be true before an insert or an update to a column or group of columns is allowed. - A
CHARACTER SET
can be specified for a single column when you define the data type. If you do not specify a character set, the column assumes the database character set as a default.