Search tips
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. Modifying the system keyspace is not supported; modification attempts generate an error message.
About virtual keyspaces and tables
Provides details about virtual keyspaces and tables.
Create, alter, and drop keyspaces, tables, functions, and search indexes.
Keyspaces
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.
Tables
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.
DSE Search index enhancements
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.
CAPTURE
Appends CQL query results to a file.
CLEAR
Clears the CQL shell terminal window.
CONSISTENCY
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.
COPY TO
Exports data from a table to a CSV file.
COPY FROM
Imports data from a CSV file into a table.
DESCRIBE AGGREGATE
Lists all user-defined aggregates (UDAs) or shows the CQL definition for a specific UDA.
DESCRIBE CLUSTER
Shows high-level details about the connected cluster.
DESCRIBE SCHEMA
Shows definitions for all objects in the cluster.
DESCRIBE FUNCTION
Shows information on user-defined functions (UDFs).
DESCRIBE INDEX
Shows the definition of a specified index.
DESCRIBE KEYSPACE
Shows a list of all keyspaces in the cluster or definition of each object in a specified keyspace.
DESCRIBE MATERIALIZED VIEW
Shows the definition of the specified materialized view.
DESCRIBE SEARCH INDEX
Shows the definition of specified search index in XML format.
DESCRIBE TABLE
Shows a list of all tables in a keyspace, or executable CQL information for a single table.
DESCRIBE TYPE
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.
EXECUTE AS
Provides a testing mechanism when setting up proxy roles by running CQL commands as another role.
EXPAND
Formats query output vertically.
EXIT
Terminates the CQL shell.
LOGIN
Switches the user account without ending the CQL shell session.
PAGING
Shows query results in 100-line groups.
SERIAL CONSISTENCY
Sets the serial consistency for a lightweight transaction (LWT).
SHOW
Shows the software version, current session node, and tracing session details.
SOURCE
Executes a file containing CQL statements.
TRACING
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.
Introduction
CQL overview.
CQL data types
Describes data types.
Solr field type classes
Definitions for Apache Solr field type for DSE Search index schema.
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.