DROP KEYSPACE
Synopsis
Use the DROP KEYSPACE statement to remove a keyspace from the system.
Syntax
Diagram
Grammar
drop_keyspace ::= DROP { KEYSPACE | SCHEMA } [ IF EXISTS ] keyspace_name;
Where
keyspace_nameis an identifier.
Semantics
- An error is raised if the specified
keyspace_namedoes not exist unlessIF EXISTSoption is present. - An error is raised if the specified keyspace is non-empty (contains tables or types).
Examples
ycqlsh> CREATE KEYSPACE example;
ycqlsh> DROP KEYSPACE example;
ycqlsh> DROP KEYSPACE IF EXISTS example;