CREATE TABLE defines a table in the database. Unlike the regular CREATE TABLE statement in MySQL, in MySQL SDL, only columns, PRIMARY KEY, FOREIGN KEY constraints, and CHECK constraints can be defined.
Parameters
table_name
The name of the table.
column_name
The name of the column.
column_definition
The column definition. In MySQL SDL, PRIMARY KEY, FOREIGN KEY constraints and CHECK constraints cannot be defined in column_definition. They can only be defined separately.
key_part
index_option
reference_definition
The reference definition of a FOREIGN KEY. Note that the name of FOREIGN KEY constraints MUST be explicitly specified.
CHECK Constraints
The CHECK constraint definition. Note that the name of CHECK constraints MUST be explicitly specified.
table_options
The table options definition.
Example
CREATE INDEX statements
Syntax
Description
CREATE INDEX defines an index. Unlike the regular CREATE TABLE statement in MySQL, in MySQL SDL, indexes and unique indexes can only be defined by CREATE INDEX statements. MySQL SDL does not allow the definition of index and unique index in CREATE TABLE statements.