This is the documentation for CDH 5.1.x. Documentation for other versions is available at Cloudera Documentation.

DROP DATABASE Statement

Removes a database from the system, and deletes the corresponding *.db directory from HDFS. The database must be empty before it can be dropped, to avoid losing any data.

Syntax:

DROP (DATABASE|SCHEMA) [IF EXISTS] database_name;

Statement type: DDL

Databases, CREATE DATABASE Statement, USE Statement

Usage notes:

Before dropping a database, use a combination of DROP TABLE, DROP VIEW, ALTER TABLE, and ALTER VIEW statements, to drop all the tables and views in the database or move them to other databases.

Examples:

See CREATE DATABASE Statement for examples covering CREATE DATABASE, USE, and DROP DATABASE.

Cancellation: Cannot be cancelled.

Page generated September 3, 2015.