602SQL Documentation Index  

Complete BNF Notation of the CREATE TABLE Statement.

statement_CREATE_TABLE ::= CREATE [ IF NOT EXISTS ] TABLE [scheme.]table_name [ table_flag … ]
     	(element_description {, element_description}… )
table_flag ::= REC_PRIVILS 
element_description ::= column_description | constraint_description

column_description ::= column_name type [ DEFAULT default_value ] 
	[column_property {, column_property}… ] [ language_and_charset ]
default_value ::= expression | USER | UNIQUE 
column_property ::= PRIMARY KEY | UNIQUE | INDEX | NOT NULL | REFERENCES table_name column_name
	| CHECK ( condition )
language_and_charset ::= COLLATE [ language_name ] [ IGNORE_CASE ]
language_name ::= { CSSTRING | CSISTRING | CZ | PL | FR | DE | IT | CZ_ISO | PL_ISO | FR_ISO | DE_ISO | IT_ISO }

constraint_description ::= [CONSTRAINT constraint_name] { index_description | internal_integrity_constraint
	| referential_integrity_constraint }

index_description ::= { UNIQUE | PRIMARY KEY | INDEX } (expression [ordering] {, expression [ordering] }… ) 
	[{ NULL | NOT NULL }] 
ordering ::= ASC | DESC

internal_integrity_constraint ::= CHECK ( condition ) [ evaluation ] 

referential_integrity_constraint ::= FOREIGN KEY (column_name {, column_name}… ) 
	REFERENCES [scheme.]table_name [ column_name {, column_name}… ] 
	[ ON UPDATE referential_integrity_action ] [ ON DELETE referential_integrity_action ] 
	[ evaluation ]
referential_integrity_action ::=  SET NULL | SET DEFAULT | CASCADE | NO ACTION 

evaluation ::= INITIALLY { IMMEDIATE | DEFERRED }