Table of Contents
DROP TABLE
DROP TABLE command deletes a table from the database.
Syntax
DROP TABLE [IF EXISTS] table_name [ drop_behavior ] drop_behavior : CASCADE | RESTRICT
Arguments
[IF EXISTS]
Do not raise errors in case there is no table with the specified name.
table_name
The name of the table to delete.
drop_behavior
CASCADE or RESTRICT parameters define the way of the table deletion influence the other database objects dependable from the given table.RESTRICT parameter is used by default. If any database object is linked with the table, the deletion will be finished with an error message and the table won’t be deleted.
CASCADE If any database object is linked with the table, such object will be dropped first. It can cause a cascade of changes, therefore you should use it carefully.
Examples
DROP TABLE tblPerson; DROP TABLE IF EXISTS tblPerson;