You can execute a DROP TABLE statement to delete a table.
DROP TABLE [IF EXISTS] tbl_name;
Note If you delete a table from a PolarDB-X instance by executing a DROP TABLE statement, the corresponding physical table is automatically deleted.
- If you execute this statement to delete a table that uses global secondary indexes, the base table and the index tables are all deleted.
- Do not execute this statement to delete only index tables. To delete only index tables,
ALTER TABLE DROP INDEXstatement.
DROP TABLEstatement can delete only one table per execution. If you try to delete multiple tables by executing a DROP TABLE statement, an error is returned.
You can execute the following statement to delete a table named
DROP TABLE user_log;