Jump to main content
DataStax LunaEnterprise Support for Apache Cassandra  —  Start a Free 30-Day Trial Now.
About CQL
CQL (Cassandra Query Language) is a query language for the DataStax Enterprise database.
CQL quick reference
Provides a consolidated syntax list of Cassandra Query Language (CQL) commands for quick reference.
Basic rules to follow when designing a DataStax Enterprise database.
Data modeling concepts
Uses a Pro cycling example to demonstrate the query drive approach to data modeling.
Data modeling analysis
Analyze the design based on storage, capacity, redundancy, and consistency.
Using materialized views
Learn about materialized views, which are tables with data that is automatically inserted and updated from another base table.
Shows the CQL command syntax and rules, and provides instruction on using CQL shell (cqlsh).
Accessing data using CQL
Common ways to access data include cqlsh, drivers, and DataStax Studio.
Understanding the CQL command syntax
Basic rules and limitations for writing CQL statements; including case, valid characters, escaping characters, keyspace qualifiers, commenting, keywords, and exponential notation.
About system keyspace tables
Provides details about database objects and cluster configuration in the system keyspace tables.
Create, alter, and drop keyspaces, tables, functions, and search indexes.
Create and drop keyspaces, and manage the replication factor (data availability).
Types, functions and aggregates
Create, replace, alter, and drop customized user-defined functions, aggregates, and types.
How to create tables to store data.
Search Indexes
Create and configure a search index on an existing table.
How to insert data into a table with either regular or JSON data.
Using INSERT and UPDATE to write values
Inserting set data with the INSERT command.
Using lightweight transactions
INSERT and UPDATE statements that use the IF clause support lightweight transactions, also known as Compare and Set (CAS).
Inserting JSON formatted values
Inserting JSON data with the INSERT command for testing queries.
Importing data from a CSV file
Inserting data with the cqlsh command COPY from a CSV file is common for testing queries.
Deleting values
Use the DELETE command to replace the value in a column with null or to remove an entire row of data.
Expiring data with time-to-live
Use time-to-live (TTL) to expire data in a column or table.
Batching inserts and updates
Performing multiple writes in the same command.
Retrieve data sets from a table using SELECT statements.
About SELECT statements
Retrieving data from tables.
Setting consistency levels
Set the consistency level to control the accuracy of the data returned by read request.
Restricting queries using WHERE clauses
Describes restrictions of partition and clustering columns in a WHERE clause.
Filtering using a search index
DataStax Enterprise supports production-grade implementation of CQL Solr queries in DSE Search.
Returning collections
How to retrieve data from a collection.
Aggregating results
Using the SELECT command to return data and apply standard aggregate functions.
Using user-defined functions (UDF)
Using the SELECT command to return data and applying a UDF.
Returning the write timestamp
Using the WRITETIME function in a SELECT statement to determine when the date/time that the column was written to the database.
Formatting query results as JSON
Use the SELECT command to return JSON data.
Commands specific to the Cassandra Query Language shell (cqlsh) utility.
cqlsh (startup options)
Describes the options for starting the CQL shell.
Configuring a cqlshrc file
A cqlshrc file contains CQL shell session settings that are used when the CQL shell starts.
Appends CQL query results to a file.
Clears the CQL shell terminal window.
Determines how many nodes in the replica must respond for the coordinator node to successfully process a non-lightweight transaction (non-LWT) during the CQL shell session.
Exports data from a table to a CSV file.
Imports data from a CSV file into a table.
Lists all user-defined aggregates (UDAs) or shows the CQL definition for a specific UDA.
Shows high-level details about the connected cluster.
Shows definitions for all objects in the cluster.
Shows information on user-defined functions (UDFs).
Shows the definition of a specified index.
Shows a list of all keyspaces in the cluster or definition of each object in a specified keyspace.
Shows the definition of the specified materialized view.
Shows the definition of specified search index in XML format.
Shows a list of all tables in a keyspace, or executable CQL information for a single table.
Lists user-defined types (UDTs) in the current keyspace, or all UDTs in the cluster when no keyspace is selected, or the CQL definition for a specified UDT.
Provides a testing mechanism when setting up proxy roles by running CQL commands as another role.
Formats query output vertically.
Terminates the CQL shell.
Switches the user account without ending the CQL shell session.
Shows query results in 100-line groups.
Sets the serial consistency for a lightweight transaction (LWT).
Shows the software version, current session node, and tracing session details.
Executes a file containing CQL statements.
Enables or disables request tracing for all CQL statements in the current CQLSH session.
Provides a brief description and syntax for CQL statements, types, operators, and functions supported by the DataStax Enterprise database.
CQL overview.
CQL data types
Describes data types.
Search index field type classes
Definitions for DSE Search index schema field types.
CQL Operators
Describes the CQL operators.
CQL native functions
Describes scalar functions that work on values in a single row of data to create a new value.
CQL native aggregates
Works on a set of rows matching the SELECT statement to return a single value.
CQL commands
Describes Cassandra Query Language (CQL) statements supported by the DataStax Enterprise database.
CQL description of keyspaces, tables and other database resources used in CQL examples.
Setting up the Cycling keyspace
CQL commands to set up the cycling keyspace and examples used in this guide.
Search index examples
Step-by-step tutorials with sample keyspaces, tables, and data that demonstrate DSE Search index functionality.