Deletes a table from the database. PolarDB-X uses the same syntax as MySQL and automatically deletes the corresponding physical tables at the same time.
Syntax
DROP TABLE [IF EXISTS] tbl_name;Usage notes
Dropping a table that has a global secondary index (GSI) also drops the GSI's index table automatically.
You cannot use
DROP TABLEto delete an index table directly. To remove a GSI, useALTER TABLE DROP INDEXinstead.To prevent accidental deletion, the
DROP TABLEstatement can delete only one table at a time. If you attempt to delete multiple tables at once, an error is reported.
Example
Drop the user_log table:
DROP TABLE user_log;