Column definition 

A column definition defines a column in a table. The name and data type of each column are defined by the column name and data type. The column names must be unique within a base table.

Syntax

<column_definition> ::= <column_name> <data_type> [<column_attributes>]
| <column_name> <domain_name> [<column_attributes>]

column_name, data_type, column_attributes, domain_name

Explanation

If the [PRIMARY] KEY column attribute is specified, the CREATE TABLE statement must not contain a key definition.

A column definition may only consist of a column name if a QUERY expression is used in the CREATE TABLE statement.

If a column name and domain name (the name of a value range) are specified, the domain name must identify an existing domain. The data type and the length of the domain are assigned to the specified column. If the domain has a constraint_definition, the effect is the same as if the corresponding CONSTRAINT definition were specified in the column attribute of the column definition.

Columns, which are part of the key, or for which NOT NULL was defined, are called NOT NULL columns. A NULL value cannot be inserted in these columns.

If an index is generated for an individual optional column, it does not contain the rows in which the NULL value is specified for this column. With certain queries, therefore, the most effective search strategy cannot be selected via this index. NOT NULL, therefore, should be specified for all columns where the NULL value will not occur. For columns where the NULL value could occur, the definition of a DEFAULT specification should be considered, because its value is used instead of the NULL value. Rows with the DEFAULT value are contained in an index.

Memory requirements of a column value as a function of the data type

The memory requirements of all columns in a table must not exceed 8088 bytes.