Help Center > > Developer Guide> SQL Reference> SQL Syntax> DROP TABLE

DROP TABLE

Updated at: May 15, 2019 GMT+08:00

Function

DROP TABLE deletes a specified table.

Precautions

DROP TABLE forcibly deletes a specified table. After a table is deleted, any indexes that exist for the table will be deleted; any functions or stored procedures that use this table cannot be run. Deleting a partitioned table also deletes all partitions in the table.

Syntax

DROP TABLE [ IF EXISTS ] 
    { [schema.]table_name } [, ...] [ CASCADE | RESTRICT ];

Parameter Description

  • IF EXISTS

    Sends a notice instead of an error if the specified table does not exist.

  • schema

    Specifies the schema name.

  • table_name

    Specifies the name of the table.

  • CASCADE | RESTRICT
    • CASCADE: automatically deletes objects (such as views) that depend on the table to be deleted.
    • RESTRICT (default): refuses to delete the table if any objects depend on it. This is the default.

Examples

For details, see Examples of CREATE TABLE.

Helpful Links

ALTER TABLE, CREATE TABLE

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel