Apache Cassandra 1.1 Documentation

USE

This document corresponds to an earlier product version. Make sure you are using the version that corresponds to your version.

Latest Cassandra documentation | Earlier Cassandra documentation

Connects the current client session to a keyspace.

Synopsis

USE <keyspace_name>;

Description

A USE statement tells the current client session and the connected Cassandra instance which keyspace you will be working in. All subsequent operations on column families and indexes are in the context of the named keyspace, unless otherwise specified or until the client connection is terminated or another USE statement is issued.

Example

USE PortfolioDemo;

CQL Commands

CQL Commands CQL Shell Commands
ALTER TABLE ASSUME
ALTER KEYSPACE CAPTURE
BATCH COPY
CREATE TABLE DESCRIBE
CREATE INDEX EXIT
CREATE KEYSPACE SHOW
DELETE SOURCE
DROP TABLE  
DROP INDEX  
DROP KEYSPACE  
INSERT  
SELECT  
TRUNCATE  
UPDATE  
USE