Below are the commands useful for querying the cassandra database .
These are executed by logging into the Cassandra command line interface(CLI), CQLSH
1) showing the keyspaces(or databases )
describe keyspaces;
2) Showing Tables in the keyspace(or database)
2.1. use <keyspace_name>;
2.2 describe tables; this will show the tables in the keyspace(database)
3) Creating Index to an Exiting table with column
CREATE INDEX tripid_idx ON table_4(tripid);
4) To show TABLE info using cqlsh
DESC TABLE table_1 ;
These are executed by logging into the Cassandra command line interface(CLI), CQLSH
1) showing the keyspaces(or databases )
describe keyspaces;
2) Showing Tables in the keyspace(or database)
2.1. use <keyspace_name>;
2.2 describe tables; this will show the tables in the keyspace(database)
3) Creating Index to an Exiting table with column
CREATE INDEX tripid_idx ON table_4(tripid);
4) To show TABLE info using cqlsh
DESC TABLE table_1 ;
No comments:
Post a Comment