In this tutorial, we will learn about the CREATE Table command in Cassandra which allows us to create new table using cqlsh by providing the valid column names, data types.

Syntax:

Example:

In the above example, LearningStore is keyspace and user_id is where the primary key which consists of only one column.

Compounded PrimaryKey:

This consists more than one column as primary key. Cassandra treats the first column as partition key.

Column definition Syntax:

Example:

Validate the Table Creation

Make sure that you are in LearningStoreKeyspace before giving the below command.