Keywords

Reserved keywords have specific meaning in CQL. To use a reserved keyword as an identifier for a keyspace, table, column, function, or user-defined type name, enclose it in double quotes.

Non-reserved keywords are keywords that behave like a reserved keyword, but only in a specific place in a command. Non-reserved keywords can be used as an identifier outside this context without double quotes. However, the database automatically encloses the keyword in double quotes, so any additional actions must include double quotes to reference the object.

CQL Basic Reserved keywords

To use reserved keywords as an identifier in CQL, enclose in double quotes. For example:

CREATE TABLE cycling."addThis" (
  a int PRIMARY KEY
);

Reserved keyword list:

  • ADD

  • ALLOW

  • ALTER

  • AND

  • APPLY

  • ASC

  • AUTHORIZE

  • BATCH

  • BEGIN

  • BY

  • COLUMNFAMILY

  • CREATE

  • DEFAULT

  • DELETE

  • DESC

  • DESCRIBE

  • DROP

  • ENTRIES

  • EXECUTE

  • FOR

  • FROM

  • FULL

  • GRANT

  • IF

  • IN

  • INDEX

  • INFINITY

  • INSERT

  • INTO

  • IS

  • KEYSPACES

  • LIMIT

  • MATERIALIZED

  • MBEAN

  • MBEANS

  • MODIFY

  • NAN

  • NORECURSIVE

  • NOT

  • NULL

  • OF

  • ON

  • OR

  • ORDER

  • PRIMARY

  • RENAME

  • REPLACE

  • REVOKE

  • SCHEMA

  • SELECT

  • SET

  • TABLE

  • TO

  • TOKEN

  • TRUNCATE

  • UNLOGGED

  • UNSET

  • UPDATE

  • USE

  • USING

  • VIEW

  • WHERE

  • WITH

CQL Basic Non-reserved keywords

Non-reserved keywords can be used as an identifier without double quotes outside the specific place that the keyword has meaning in a command.

Non-reserved keyword list:

  • AGGREGATE

  • ALL

  • AS

  • CALLED

  • CAST

  • CLUSTERING

  • COMPACT

  • CONTAINS

  • COUNT

  • CUSTOM

  • DISTINCT

  • EXISTS

  • FILTERING

  • FINALFUNC

  • FROZEN

  • FUNCTION

  • FUNCTIONS

  • GROUP

  • INITCOND

  • INPUT

  • JSON

  • KEY

  • KEYS

  • KEYSPACE

  • LANGUAGE

  • LIKE

  • LIST

  • LOGIN

  • MAP

  • NOLOGIN

  • NOSUPERUSER

  • OPTIONS

  • PARTITION

  • PASSWORD

  • PER

  • PERMISSION

  • PERMISSIONS

  • RESTRICT

  • RETURNS

  • ROLE

  • ROLES

  • SFUNC

  • STATIC

  • STORAGE

  • STYPE

  • SUPERUSER

  • TRIGGER

  • TTL

  • TYPE

  • USER

  • USERS

  • VALUES

  • WRITETIME

All CQL data types are also non-reserved keywords:

  • ASCII

  • BIGINT

  • BLOB

  • BOOLEAN

  • COUNTER

  • DATE

  • DECIMAL

  • DOUBLE

  • DURATION

  • FLOAT

  • INET

  • INT

  • SMALLINT

  • TEXT

  • TIME

  • TIMESTAMP

  • TIMEUUID

  • TINYINT

  • TUPLE

  • UNRESTRICT

  • UUID

  • VARCHAR

  • VARINT

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com