Delete a table.

 

Syntax

 

<drop table statement> ::=

 

 

 

DROP TABLE [ IF EXISTS ] [ schema-name. ] table-name [ RESTRICT ]

 

 

Usage

 

The DROP TABLE statement deletes the table specified by table-name from the database.

 

 

Notes

 

The current database is implicit if a schema name is not specified.



 

The IF EXISTS clause can be specified to avoid an exception when attempting to delete a table that does not exist in the database.



 

Dropping a table automatically deletes all indexes and triggers owned by the table.



 

RESTRICT, which is implicit and the only supported drop behavior, prevents the table from being deleted if the table is referenced by other tables, views, triggers, procedures or functions.



 

The DROP TABLE statement requires exclusive access to the table being deleted.



 

 

Examples

 

1)

The following example deletes the ##students table:



 


DROP TABLE IF EXISTS ##students



 

 


 

Conformance

 

SQL:2003 standard

 

NexusDB extensions

-

 

-

Core SQL

 

IF EXISTS clause