USE Command in Cassandra Query Language - Cassandra / CQL Tutorial

How to use USE Command in Cassandra Query Language ( CQL)

If you been working with Database , you have used "USE Command" many times in a day to switch between databases. In Cassandra we can also use the USE Command to switch between Keyspaces.

Syntax

CQLSH>USE keyspacename;

I can get the list of all Keyspaces by using "Select * From system_schema.keyspaces". Let's say that I have TechBrothersTutorials Keyspace and I would like to change to it so I can create tables in TechBrothersTutorials keyspace. 

CQLSH:techbrotherstutorials>USE techbrotherstutorials;
 Output after executing above statement. 

1 comment: