"Fossies" - the Fresh Open Source Software Archive

Member "drizzle-7.1.36-stable/docs/create_table.rst" (6 May 2012, 1954 Bytes) of package /linux/misc/old/drizzle-7.1.36-stable.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

CREATE TABLE

A CREATE statement in SQL creates an object inside of Drizzle. One of the most common CREATE commands is the CREATE TABLE command.

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] table_name
  (create_definition, ...)
  [engine_options]
  REPLICATE=[TRUE|FALSE] 

or:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] table_name
  [(create_definition, ...)]
  [engine_options]
  select_statement
  REPLICATE=[TRUE|FALSE] 

or:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] table_name
  LIKE different_table_name
  [engine_options]
  REPLICATE=[TRUE|FALSE] 

create_definition

column_name column_definition
[CONSTRAINT [symbol] ] PRIMARY KEY [index_type]
(index_column_name, ...)
INDEX [index_name] (index_column_name, ...)
(index_column_name, ...)
[CONSTRAINT [symbol] ] UNIQUE [INDEX]
(index_column_name, ...)
[CONSTRAINT [symbol] ] FOREIGN KEY [index_name] (index_column_name, ...)
reference_definition
CHECK (expr)

column_definition

data_type [NOT NULL | NULL] [DEFAULT default_value]
[AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY]
[COMMENT 'string']
[reference_definition]

data_type

reference_option

RESTRICT | CASCADE | SET NULL | NO ACTION

engine_options

engine_option [[,] engine_option] ...

engine_option

ENGINE = engine_name { engine_specific }

REPLICATE

Specify whether or not a TABLE should be replicated.

REPLICATE=[TRUE|FALSE]