How to change a table name in SQL ?

This is the command to change a table name in SQL:


ALTER TABLE table_name
RENAME TO new_table_name;

We will start off by giving the keywords ALTER TABLE, then we will follow it up by giving the original name of the table, after that, we will give in the keywords RENAME TO and finally, we will give the new table name.

For example, if we want to change the “employee” table to “employee_information”, this will be the command:


ALTER TABLE employee
RENAME TO employee_information;
How to change a table name in SQL ?

Published on 12-Dec-2021 20:48:01

You may also like this!