Cassandra – Create Index
Creating an Index using Cqlsh You can create an index in Cassandra using the command CREATE INDEX. Its syntax is as follows − CREATE INDEX <identifier> ON <tablename> Given below is an…
Creating an Index using Cqlsh You can create an index in Cassandra using the command CREATE INDEX. Its syntax is as follows − CREATE INDEX <identifier> ON <tablename> Given below is an…
Truncating a Table You can truncate a table using the TRUNCATE command. When you truncate a table, all the rows of the table are deleted permanently. Given below is the…
Dropping a Table You can drop a table using the command Drop Table. Its syntax is as follows − Syntax DROP TABLE <tablename> Example The following code drops an existing table…
Altering a Table You can alter a table using the command ALTER TABLE. Given below is the syntax for creating a table. Syntax ALTER (TABLE | COLUMNFAMILY) <tablename> <instruction> Using ALTER…
Creating a Table You can create a table using the command CREATE TABLE. Given below is the syntax for creating a table. Syntax CREATE (TABLE | COLUMNFAMILY) <tablename> ('<column-definition>' , '<column-definition>')…
Dropping a Keyspace You can drop a KeySpace using the command DROP KEYSPACE. Given below is the syntax for dropping a KeySpace. Syntax DROP KEYSPACE <identifier> i.e. DROP KEYSPACE “KeySpace name”…
Altering a KeySpace ALTER KEYSPACE can be used to alter properties such as the number of replicas and the durable_writes of a KeySpace. Given below is the syntax of this…
Creating a Keyspace using Cqlsh A keyspace in Cassandra is a namespace that defines data replication on nodes. A cluster contains one keyspace per node. Given below is the syntax…
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…
This chapter introduces the Cassandra query language shell and explains how to use its commands. By default, Cassandra provides a prompt Cassandra query language shell (cqlsh) that allows users to communicate with…