Apache Cassandra Query Language (CQL)


YugaByte supports the following CQL features.

  • Data definition language (DDL) statements.
  • Data manipulation language (DML) statements.
  • Builtin functions and Expression operators.
  • Primitive user-defined datatypes.

DDL Statements

Data definition language (DDL) statements are instructions for the following database operations.

  • Create, alter, and drop database objects
  • Create, grant, and revoke users and roles
Statement Description
ALTER TABLE Alter a table
CREATE KEYSPACE Create a new keyspace
CREATE TABLE Create a new table
CREATE TYPE Create a user-defined datatype
DROP KEYSPACE Delete a keyspace and associated objects
DROP TABLE Remove a table
DROP TYPE Remove a user-defined datatype
USE Use an existing keyspace for subsequent commands

DML Statements

Data manipulation language (DML) statements are used to read from and write to the existing database objects. YugaByte implicitly commits any updates by DML statements (similar to how Apache Cassandra behaves).

Statement Description
INSERT Insert rows into a table.
SELECT Select rows from a table.
UPDATE Update rows in a table.
DELETE Delete specific rows from a table.
TRUNCATE Remove all rows from a table.


An expression is a finite combination of one or more values, operators, functions, and expressions that specifies a computation. Expression can be used in the following components.

Currently, the following expressions are supported.

Expression Description
Simple Value Column, constant, or null. Column alias cannot be used in expression yet.
Subscript [] Subscripting columns of collection datatypes
Operator Call Builtin operators only
Function Call Builtin function calls only

Data Types

  • The following table lists all supported primitive types.
Primitive Type Allowed in Key Type Parameters Description
BIGINT Yes - 64-bit signed integer
BLOB Yes - String of binary characters
BOOLEAN No - Boolean
COUNTER No - 64-bit signed integer
DECIMAL Yes - Exact, fixed-point number
DOUBLE Yes - 64-bit, inexact, floating-point number
FLOAT Yes - 64-bit, inexact, floating-point number
FROZEN Yes 1 Collection in binary format
INET Yes - String representation of IP address
INT | INTEGER Yes - 32-bit signed integer
LIST No 1 Collection of ordered elements
MAP No 2 Collection of pairs of key-and-value elements
SET No 1 Collection of unique elements
SMALLINT Yes - 16-bit signed integer
TEXT | VARCHAR Yes - String of Unicode characters
TIMESTAMP Yes - Date-and-time
TINYINT Yes - 8-bit signed integer
UUID Yes - Standard UUID
  • User-defined datatypes are also supported.

  • The following table lists all CQL primitive types that are not yet implemented.

Primitive Type