Chapter 5 - Temporary Tables

“They can conquer who believe they can.”

- Virgil 70 BC

Create Table Syntax

CREATE [ [LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name

( { column_name data_type [column_attributes] [ column_constraints ]

| table_constraints

| LIKE parent_table [ { INCLUDING | EXCLUDING } DEFAULTS ] }

[, ... ] )

[table_attribute]

where column_attributes are:

[ DEFAULT default_expr ]

[ IDENTITY ( seed, step ) ]

[ ENCODE encoding ]

[ DISTKEY ]

[ SORTKEY ]

and column_constraints are:

[ { NOT NULL | NULL } ]

[ { UNIQUE | PRIMARY KEY } ]

[ REFERENCES reftable [ ( refcolumn ) ] ]

and table_constraints are:

[ UNIQUE ( column_name [, ... ] ) ]

[ PRIMARY KEY ( column_name [, ... ] ) ]

[ FOREIGN KEY (column_name [, ... ] ) REFERENCES reftable ...

Get Actian Matrix (Formely ParAccel) - Architecture and SQL now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.