Data type examples
The following table shows example literals for DML data types.
Data type | Examples |
---|---|
BOOLEAN |
|
TINYINT |
|
SMALLINT |
|
INT, INTEGER |
|
BIGINT |
|
REAL |
|
DOUBLE |
|
DECIMAL(precision ,
scale ) |
|
CHAR, CHAR(length ) |
|
VARCHAR, VARCHAR(length ) |
|
VARBINARY |
|
TIME, TIME(precision ) |
|
TIME WITH TIME ZONE |
|
DATE |
|
TIMESTAMP, TIMESTAMP WITHOUT TIME ZONE,
TIMESTAMP( |
|
TIMESTAMP WITH TIME ZONE,
TIMESTAMP(precision ) WITH TIME
ZONE |
|
INTERVAL YEAR TO MONTH |
|
INTERVAL DAY TO SECOND |
|
ARRAY[element_type ] |
|
MAP(key_type ,
value_type ) |
Note that maps are created from an array of keys and an array of values. The following example creates a table that maps strings to integers.
|
ROW(field_name_1
field_type_1 ,
field_name_2
field_type_2 , …) |
Note that rows created this way have no column names. To add
column names, you can use
|
JSON |
|
UUID |
|
IPADDRESS |
|