HOME
ACADEMY
DOCS
CONTACT US
DOWNLOAD DATASTAX
GLOSSARY
SUPPORT
DEVELOPER BLOGS
This document is
no longer maintained
.
CQL for Apache Cassandra™ 1.2
(Not supported)
About CQL for Cassandra 1.2
CQL data modeling
Introduction
Data modeling
Example of a music service
Compound keys and clustering
Collection columns
Adding a collection to a table
Updating a collection
Querying a collection
When to use a collection
Expiring columns
Counter columns
Using natural or surrogate primary keys
Indexing
When to use an index
About indexing
Using multiple indexes
Building and maintaining indexes
Working with pre-CQL 3 applications
Querying a legacy table
Using a CQL 3 query
Using CQL
Using CQL
Starting cqlsh
Starting cqlsh on Linux
Starting cqlsh on Windows
Starting cqlsh in CQL 2 mode
Using tab completion
Creating and updating a keyspace
Example of creating a keyspace
Updating the replication factor
Creating a table
Using a compound primary key
Inserting data into a table
Querying a system table
Keyspace, table, and column information
Cluster information
Retrieving and sorting results
Using the keyspace qualifier
Determining time-to-live for a column
Determining the date/time of a write
Adding columns to a table
Altering the data type of a column
Removing data
Expiring columns
Dropping a table or keyspace
Deleting columns and rows
Using collections
Using the set type
Using the list type
Using the map type
Indexing a column
Paging through unordered partitioner results
Using a counter
CQL reference
Introduction
CQL lexical structure
Uppercase and lowercase
Escaping characters
Valid literals
Exponential notation
CQL Keywords
Data types
Blob
Collection types
UUID and timeuuid
Timeuuid functions
Timestamp type
Counter type
Keyspace properties
Table properties
Subproperties of compaction
Subproperties of compression
cqlsh commands
cqlsh
ASSUME
CAPTURE
CONSISTENCY
COPY
DESCRIBE
EXIT
SHOW
SOURCE
TRACING
CQL commands
ALTER KEYSPACE
ALTER TABLE
ALTER USER
BATCH
CREATE INDEX
CREATE KEYSPACE
CREATE TABLE
CREATE USER
DELETE
DROP INDEX
DROP KEYSPACE
DROP TABLE
DROP USER
GRANT
INSERT
LIST PERMISSIONS
LIST USERS
REVOKE
SELECT
TRUNCATE
UPDATE
USE
Home
Academy
Docs home
Contact us
Download DataStax
Glossary
Support
Developer blogs
Search
Home
Using CQL
Using CQL
Topics for using CQL.
Using CQL
You can use CQL on the command line of a Cassandra node, from DataStax DevCenter, or programmatically using a number of APIs and drivers.
Starting cqlsh
How to start cqlsh.
Using tab completion
You can use tab completion to see hints about how to complete a cqlsh command.
Creating and updating a keyspace
Creating a keyspace is the CQL counterpart to creating an SQL database.
Creating a table
Steps for creating a table with a single primary key.
Querying a system table
Details about Cassandra database objects and cluster configuration in the system keyspace tables.
Retrieving and sorting results
Using the SELECT command.
Using the keyspace qualifier
To simplify tracking multiple keyspaces, use the keyspace qualifier instead of the USE statement.
Determining time-to-live for a column
Steps for creating a table, inserting data into two columns, and calling the TTL function to retrieve the date/time of the writes to the columns.
Determining the date/time of a write
Using the WRITETIME function in a SELECT statement to return the date/time in microseconds when the column was written to the database.
Adding columns to a table
Using the ALTER TABLE command to add new columns to a table.
Altering the data type of a column
Using ALTER TABLE, you can change the data type of a column after it is defined or added to a table.
Removing data
Setting the column values for automatic removal using the TTL (time-to-expire) table attribute.
Using collections
Collection types provide an improved way of handling tasks, such as building multiple email address capability into tables.
Indexing a column
Using cqlsh to create an index on column values.
Paging through unordered partitioner results
Using CQL to page through rows.
Using a counter
A counter is a special column for storing a number that is changed in increments.
Using CQL
Using CQL
Starting cqlsh
Using tab completion
Creating and updating a keyspace
Creating a table
Querying a system table
Retrieving and sorting results
Using the keyspace qualifier
Determining time-to-live for a column
Determining the date/time of a write
Adding columns to a table
Altering the data type of a column
Removing data
Using collections
Indexing a column
Paging through unordered partitioner results
Using a counter