DROP KEYSPACE
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
The DROP KEYSPACE
statement removes a keyspace and all its database objects (such as tables or types) from the system.
Syntax
Diagram
Grammar
drop_keyspace ::= DROP { KEYSPACE | SCHEMA } [ IF EXISTS ] keyspace_name;
Where
keyspace_name
is an identifier.
Semantics
- An error is raised if the specified
keyspace_name
does not exist unlessIF EXISTS
option is present. - An error is raised if the specified keyspace is non-empty (contains tables or types).
Examples
You can do this as shown below.
cqlsh> CREATE KEYSPACE example;
cqlsh> DROP KEYSPACE example;
cqlsh> DROP KEYSPACE IF EXISTS example;
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .