Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Case Data Model > SQL syntax > DDL statements > CREATE TABLE
 
CREATE TABLE
The CREATE TABLE statement creates a new table.
Syntax
CREATE TABLE
  table
(
column column_def [,column column_def ... ]
)
Elements
column_def
data_type
data_type
LONG | DOUBLE | TEXT [(size)] | CATEGORICAL [(size [,cat_elms])] | BOOLEAN | DATE | OBJECT | LEVEL
cat_elms
size | {cat_name [, cat_name]}
size
For text columns, this is the maximum number of characters. For categorical columns, this is the maximum number of responses. For categories, this is the total number of categories, in which case the categories are automatically named columnN, where N is the category's position.
Notes
There is no need to specify the database or table owner as these concepts are not defined in the Provider. There is also no concept of column constraints, such as NOT NULL, or check constraints.
Example
CREATE TABLE VDATA (
address TEXT (300),
gender CATEGORICAL(1, {Male, Female}),
visits LONG,
distance DOUBLE
)
See also
ALTER TABLE
DROP TABLE
SQL syntax
DDL statements