Enclosed in parentheses after the table name, use a comma-separated list to define multiple columns.
All tables must have at least one Primary key column.
Each column is defined using the following syntax:
column_name cql_type_definition [STATIC | PRIMARY KEY] [, ...]
When the primary key is at the end of a column definition, that column is the only primary key for the table.
A table must have at least one
A static column cannot be a primary key.
Primary keys can include frozen collections.
Optional, the column has a single value.
- PRIMARY KEY
PRIMARY KEYis one column, append PRIMARY KEY to the end of the column definition. This is only schema information required to create a table. When there is one primary key, it is the partition key; the data is divided and stored by the unique values in this column:
column_name cql_type_definition PRIMARY KEY.
Alternatively, you can declare the primary key consisting of only one column in the same way as you declare a compound primary key.