CQL DDL: CREATE TABLE statement

Learn how to define tables in Cassandra using the CQL CREATE TABLE command, including syntax, table options, and best practices.

In this lesson, we will cover the basic syntax of CQL Data Definition Language (DDL) statements relating to an Apache Cassandra Table. To demonstrate, we will create a courses table, and perform basic queries on it. Please note that this is a very simple table with native data types and a one-column primary key. We will add complexity to the statements, as the course proceeds.

The CREATE TABLE command

The CREATE TABLE command is used to define a new table. Each table must have a name. The name length is limited to 48 alphanumeric characters. By default, table names are case-insensitive, i.e., Table1 and table1 can be used interchangeably in queries. Case sensitivity can be enforced by enclosing the name in double quotes, i.e., "Table1" and "table1" are treated as two separate tables. 

Get hands-on with 1300+ tech skills courses.