Background documentationDROP SCHEMA Statement (drop_schema_statement) Locate this document in the navigation structure

 

The DROP SCHEMA statement (drop_schema_statement) drops a schema.

Structure

Syntax Syntax

  1. <drop_schema_statement> ::=
      DROP SCHEMA <schema_name> [<cascade_option>]
End of the code.
Examples

SQL Tutorial, Schemas

Explanation

The current database user must be the owner of the schema that is to be dropped.

The metadata of the specified schema is dropped from the database catalog.

If no CASCADE option or the CASCADE option CASCADE was specified, all the database objects that belong to the schema to be dropped are also dropped.

If the CASCADE option RESTRICT was specified and objects still exist that belong to the schema, the DROP SCHEMA statement fails.