Have a question or want live help from a DataStax engineer? Let's chat.
Can't find what you're looking for? Try searching other guides
Cassandra Query Language (CQL) is a query language for the Apache Cassandra database.
Data modeling topics.
CQL provides an API to Apache Cassandra that is simpler than the Thrift API for new applications.
How to start cqlsh.
A brief description on starting cqlsh on Linux.
A brief description on starting cqlsh on Windows.
You can use tab completion to see hints about how to complete a cqlsh command.
Creating a keyspace is the CQL counterpart to creating an SQL database.
Steps for creating a table with a single primary key.
An example of creating a user-defined type to attach multiple data fields to a column.
Details about Apache Cassandra database objects and cluster configuration in the system keyspace tables.
Using the SELECT command.
The IN keyword can define a set of clustering columns to fetch together, supporting a "multi-get" of CQL rows.
Slicing over rows of a partition when the table has more than one clustering column and comparing groups of clustering keys to certain values.
An example of batching conditional updates combined with static columns.
When to use batches.
To simplify tracking multiple keyspaces, use the keyspace qualifier instead of the USE statement.
Adding columns to a table with the ALTER TABLE command.
Data in a column, other than a counter column, can have an optional expiration period called TTL (time to live).
Using the DROP and DELETE commands.
Using the WRITETIME function in a SELECT statement to determine when the date/time that the column was written to the database.
Changing the data type of a column after it is defined or added to a table using ALTER TABLE.
Collection types provide an improved way of handling tasks, such as building multiple email address capability into tables.
Using cqlsh to create an index on column values.
INSERT and UPDATE statements that use the IF clause support lightweight transactions, also known as Compare and Set (CAS).
Using CQL to page through rows.
A counter is a special column for storing a number that is changed in increments.
This tutorial shows the difference between these consistency levels and the number of replicas that participate to satisfy a request.
CQL reference topics.