Introduction to Cassandra Query LanguageCassandra Query Language (CQL) is a query language for the Apache Cassandra database.
Data Modeling Concepts How data modeling should be approached for Apache Cassandra. A music service example is used throughout the CQL document.
Data modeling exampleThe music service example shows the how to use compound keys, clustering columns, and collections to model Cassandra data.
IndexingAn index provides a means to access data in Apache Cassandra™ using attributes other than the partition key for fast, efficient lookup of data matching a given condition.
Building and maintaining indexesIndexes provide operational ease for populating and maintaining the index.
Working with legacy applicationsInternally, CQL does not change the row and column mapping from the Thrift API mapping. CQL and Thrift use the same storage engine.
Using CQLCQL provides an API to Apache Cassandra that is simpler than the Thrift API for new applications.
Starting cqlshHow to start cqlsh.
Using tab completionYou can use tab completion to see hints about how to complete a cqlsh command.
Creating and updating a keyspaceCreating a keyspace is the CQL counterpart to creating an SQL database.
Creating a tableSteps for creating a table with a single primary key.
Using a user-defined typeAn example of creating a user-defined type to attach multiple data fields to a column.
Querying a system tableDetails about Apache Cassandra database objects and cluster configuration in the system keyspace tables.
Retrieval using the IN keywordThe IN keyword can define a set of clustering columns to fetch together, supporting a "multi-get" of CQL rows.
Slicing over partition rowsSlicing over rows of a partition when the table has more than one clustering column and comparing groups of clustering keys to certain values.
Batching conditional updates to a static columnAn example of batching conditional updates combined with static columns.
Using the keyspace qualifierTo simplify tracking multiple keyspaces, use the keyspace qualifier instead of the USE statement.
Adding columns to a tableAdding columns to a table with the ALTER TABLE command.
Expiring dataData in a column, other than a counter column, can have an optional expiration period called TTL (time to live).
Determining the date/time of a writeUsing the WRITETIME function in a SELECT statement to determine when the date/time that the column was written to the database.
Altering the data type of a columnChanging the data type of a column after it is defined or added to a table using ALTER TABLE.
Using collectionsCollection types provide an improved way of handling tasks, such as building multiple email address capability into tables.
Indexing a columnUsing cqlsh to create an index on column values.
Using lightweight transactionsINSERT and UPDATE statements that use the IF clause support lightweight transactions, also known as Compare and Set (CAS).
Using a counterA counter is a special column for storing a number that is changed in increments.
Tracing consistency changesThis tutorial shows the difference between these consistency levels and the number of replicas that participate to satisfy a request.
IntroductionAbout using CQL.
CQL lexical structureCQL input consists of statements that change data, look up data, store data, or change the way data is stored.
CQL data typesBuilt-in data types for columns.
CQL keyspace and table propertiesAbout using CQL keyspace and table properties.
FunctionsCQL support functions for transforming one or more column values into a new value.
CQL limitsUpper CQL limits.
cqlsh commandsThe cqlsh commands.
CQL commandsCQL commands.