Cassandra Cheat Sheet



  • Cassandra Tutorial

Download InfoWorld’s ultimate R data.table cheat sheet; COVID-19 crisis accelerates rise of virtual call centers. He has also worked as chief evangelist for Apache Cassandra and consultant. Apache Cassandra is a high-performance, extremely scalable, fault tolerant (i.e., no single point of failure), distributed non-relational database solution. Cassandra combines all the benefits of Google Bigtable and Amazon Dynamo to handle the types of database management needs that traditional RDBMS vendors.

  • Cassandra Keyspace Operations
  • Cassandra Table Operations
  • Cassandra CURD Operations
  • Cassandra CQL Types
  • Cassandra Useful Resources
  • Selected Reading

Cassandra provides documented shell commands in addition to CQL commands. Given below are the Cassandra documented shell commands.

Help

The HELP command displays a synopsis and a brief description of all cqlsh commands. Given below is the usage of help command.

Capture

This command captures the output of a command and adds it to a file. For example, take a look at the following code that captures the output to a file named Outputfile.

When we type any command in the terminal, the output will be captured by thefile given. Given below is the command used and the snapshot of the output file.

Cassandra Cheat Sheet Pdf

You can turn capturing off using the following command.

Consistency

This command shows the current consistency level, or sets a new consistency level.

Copy

This command copies data to and from Cassandra to a file. Given below is an example to copy the table named emp to the file myfile.

If you open and verify the file given, you can find the copied data as shown below.

Cassandra Cheat Sheet

Describe

This command describes the current cluster of Cassandra and its objects. The variants of this command are explained below.

Describe cluster − This command provides information about the cluster.

Describe Keyspaces − This command lists all the keyspaces in a cluster. Given below is the usage of this command.

Describe tables − This command lists all the tables in a keyspace. Given below is the usage of this command.

Describe table − This command provides the description of a table. Given below is the usage of this command.

Describe Type

This command is used to describe a user-defined data type. Given below is theusage of this command.

Describe Types

This command lists all the user-defined data types. Given below is the usage of this command. Assume there are two user-defined data types: card and card_details.

Expand

Cassandra Cheat Sheet 2020

This command is used to expand the output. Before using this command, you have to turn the expand command on. Given below is the usage of this command.

Note − You can turn the expand option off using the following command.

Exit

This command is used to terminate the cql shell.

Show

This command displays the details of current cqlsh session such as Cassandra version, host, or data type assumptions. Given below is the usage of this command.

Source

Using this command, you can execute the commands in a file. Suppose our input file is as follows −

Then you can execute the file containing the commands as shown below.

-->

APPLIES TO: SQL API

The Azure Cosmos DB query cheat sheets help you quickly write queries for your data by displaying common database queries, operations, functions, and operators in easy-to-print PDF reference sheets. The cheat sheets include reference information for the SQL, MongoDB, Table, and Gremlin APIs.

Choose from a letter-sized or A3-sized download.

Letter-sized cheat sheets

Download the Azure Cosmos DB letter-sized query cheat sheets if you're going to print to letter-sized paper (8.5' x 11').

Oversized cheat sheets

Download the Azure Cosmos DB A3-sized query cheat sheets if you're going to print using a plotter or large-scale printer on A3-sized paper (11.7' x 16.5').

Next steps

SheetCassandra

For more help writing queries, see the following articles:

Sheet

Cassandra Cheat Sheet

  • For SQL API queries, see Query using the SQL API, SQL queries for Azure Cosmos DB, and SQL syntax reference
  • For MongoDB queries, see Query using Azure Cosmos DB's API for MongoDB and Azure Cosmos DB's API for MongoDB feature support and syntax
  • For Gremlin API queries, see Query using the Gremlin API and Azure Cosmos DB Gremlin graph support
  • For Table API queries, see Query using the Table API