This topic describes how to use the DROP TABLE statement to delete a specified table.

Syntax

DROP [TEMPORARY] TABLE [IF EXISTS]
    tbl_name [, tbl_name] ...
    [RESTRICT | CASCADE]
Note Data tables in DRDS can be deleted by using the same syntax that is used to delete tables in MySQL databases. The system automatically processes or deletes the related physical tables. For more information, see DROP TABLE statement.

Note

  • If you execute the DROP TABLE statement to delete a table that contains a global secondary index, the index table and the primary table are both deleted.
  • To delete only the index table, execute the ALTER TABLE DROP INDEX statement instead of the DROP TABLE statement. For more information, see ALTER TABLE.

Examples

The following example shows how to delete the table named user_log:

DROP TABLE user_log;