CREATE TABLE Statement syntax in Snowflake
Use the create table statement to create a new permanent table:
Example:
create or replace table emp_basic (
first_name string ,
last_name string ,
email string ,
streetaddress string ,
city string ,
start_date date
);
Syntax:
CREATE [ OR REPLACE ] [ { [ LOCAL | GLOBAL ] TEMP[ORARY] | VOLATILE } | TRANSIENT ] TABLE [ IF NOT EXISTS ]
<table_name>
( <col_name> <col_type> [ { DEFAULT <expr>
| { AUTOINCREMENT | IDENTITY } [ ( <start_num> , <step_num> ) | START <num> INCREMENT <num> ] } ]
/* AUTOINCREMENT / IDENTITY supported only for numeric data types (NUMBER, INT, etc.) */
[ inlineConstraint ]
[ , <col_name> <col_type> ... ]
[ , outoflineConstraint ]
[ , ... ] )
[ CLUSTER BY ( <expr> [ , <expr> , ... ] ) ]
[ STAGE_FILE_FORMAT = ( { FORMAT_NAME = '<file_format_name>'
| TYPE = { CSV | JSON | AVRO | ORC | PARQUET | XML } [ formatTypeOptions ] } ) ]
[ STAGE_COPY_OPTIONS = ( copyOptions ) ]
[ DATA_RETENTION_TIME_IN_DAYS = <num> ]
[ COPY GRANTS ]
[ COMMENT = '<string_literal>' ]
Atori
posted on 20 Oct 18Enjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment