Creating a table

Data in Cassandra is organized into storage structures known as tables. Some older documentation may refer to tables as column families. If someone refers to column families, it is safe to assume that they are referring to structures in older versions of Apache Cassandra:

CREATE TABLE [IF NOT EXISTS] [keyspace_name.]<table_name> <column_name> <column_type>, [additional <column_name> <column_type>,] PRIMARY KEY ((<partition_key>[,additional <partition_key>])[,<clustering_keys]);[WITH <options>];

Get Mastering Apache Cassandra 3.x - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.