📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

RENAME TABLE



Changes the name of a table.

Syntax

ALTER TABLE [ IF EXISTS ] <name> RENAME TO <new_table_name>

Examples

CREATE TABLE test(a INT);
SHOW TABLES; +------+ | name | +------+ | test | +------+
ALTER TABLE `test` RENAME TO `new_test`;
SHOW TABLES; +----------+ | name | +----------+ | new_test | +----------+

Was this page helpful?