8. SQL Statements : CREATE TABLE : Column Specification--Define Column Characteristics : With|Not Null and With|Not Default Combinations
 
Share this page                  
With|Not Null and With|Not Default Combinations
The WITH|NOT NULL clause works in combination with the WITH|NOT DEFAULT clause, as follows:
WITH NULL
The column accepts nulls. If no value is provided, the DBMS Server inserts a null.
WITH NULL WITH DEFAULT
The column accepts null values. If no value is provided, the DBMS Server inserts a 0 or blank string, depending on the data type.
WITH NULL NOT DEFAULT
The column accepts null values. The user must provide a value (mandatory column).
NOT NULL WITH DEFAULT
The column does not accept nulls. If no value is provided, the DBMS Server inserts 0 for numeric and money columns, or an empty string for character and date columns.
NOT NULL NOT DEFAULT (or NOT NULL)
The column is mandatory and does not accept nulls, which is typical for primary key columns.