All Products
Search
Document Center

PolarDB:DROP TABLE

Last Updated:Mar 28, 2026

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 TABLE to delete an index table directly. To remove a GSI, use ALTER TABLE DROP INDEX instead.

  • To prevent accidental deletion, the DROP TABLE statement 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;

See also