# column-definition

    Simple-column-Name DataType
        [ Column-level-constraint ]*
        [ [ WITH ] DEFAULT DefaultConstantExpression
           |generated-column-spec ]
        [ Column-level-constraint ]*

The syntax of DataType is described in Data types.

The syntaxes of Column-level-constraint and Table-level constraint are described in CONSTRAINT clause.

#### Column default

For the definition of a default value, a DefaultConstantExpression is an expression that does not refer to any table. It can include constants, date-time special registers, current schemas, users, and null:

    DefaultConstantExpression:
              NULL
            | CURRENT { SCHEMA | SQLID }
            | USER | CURRENT_USER | SESSION_USER
            | DATE
            | TIME
            | TIMESTAMP
            | CURRENT DATE | CURRENT_DATE
            | CURRENT TIME | CURRENT_TIME
            | CURRENT TIMESTAMP | CURRENT_TIMESTAMP
            | literal

For details about Derby literal values, see Data types.

The values in a DefaultConstantExpression must be compatible in type with the column, but a DefaultConstantExpression has the following additional type restrictions:

- If you specify USER, CURRENT_USER or SESSION_USER, the column must be a character column whose length is at least 8.
- If you specify CURRENT SCHEMA or CURRENT SQLID, the column must be a character column whose length is at least 128.
- If the column is an integer type, the default value must be an integer literal.
- If the column is a decimal type, the scale and precision of the default value must be within those of the column.

Parent topic: CREATE TABLE statement
Related reference
generated-column-spec