SQL Rename Table – Modify name of a Table

SQL Rename a table example – Learn how to rename existing table name in MySQL database with example and important points.

SQL RENAME TABLE is used to change name of the existing table.

SQL Rename table syntax

Syntax:

RENAME TABLE
[old_table_name] TO [new_table_name];

or

ALTER TABLE [table_name]
RENAME TO [new_table_name];

 Example to rename existing table name to new table name.

query example:

RENAME TABLE   ORDERDETAILS TO ORDER_DETAILS;

or

ALTER TABLE ORDERDETAILS
RENAME TO ORDER_DETAILS;

the above query renames the table name “ORDERDETAILS” to “ORDER_DETAILS”.

Related Posts