1.1

Table Of Contents
Table ConstraintSyntax on page 481
}
[ , {
Column Definition on page 478
|
Table ConstraintSyntax on page 481
} ] * )
|
[ ( column-name [, column-name ] * ) ]
AS query-expression
WITH NO DATA
}
[
PARTITION BY Clause on page 483
| REPLICATE ]
[
SERVER GROUPS Clause on page 488
]
[
GATEWAYSENDER Clause on page 488
]
[
ASYNCEVENTLISTENER Clause on page 489
]
[
EVICTION BY Clause on page 489
]
[
EXPIRE Clause on page 490
] *
[
PERSISTENT Clause on page 491
]
Description
Tables contain columns and CONSTRAINT Clause, rules to which data must conform. Table-level constraints
specify a column or columns. Columns have a data type and can specify column constraints (column-level
constraints). The syntax of CREATE TABLE is extended to give properties to the tables that are specic to
SQLFire.
The CREATE TABLE statement has two variants depending on whether you are specifying the column denitions
and constraints (CREATE TABLE), or whether you are modeling the columns after the results of a query
expression (CREATE TABLE...AS...).
Example of CREATE TABLE
CREATE TABLE HOTELAVAILABILITY
(HOTEL_ID INT NOT NULL,
BOOKING_DATE DATE NOT NULL,
ROOMS_TAKEN INT DEFAULT 0,
PRIMARY KEY (HOTEL_ID, BOOKING_DATE));
CREATE TABLE ... AS ...
With the alternate form of the CREATE TABLE statement, you specify the column names and/or the column
data types with a query. The columns in the query result are used as a model for creating the columns in the new
table.
477
SQL Language Reference