SQL RENAME TABLE statement is used for renaming the table.

As we already discussed the syntax for renaming the column using ALTER:

ALTER TABLEtable_name
RENAME to new_table_name;

 

                                                  Or

You can generally use the following syntax

RENAMEold_table_name to new_table_name;

 

Example:

Now we take the Student table and we want to change the Student table to Employees.

StudentIDStudent_NameAddressCity
1NithinBank StreetHyderabad
2BharathPanama StreetCalifornia

 

To change the name of the table you should use any of the following syntaxes

RENAME Student to Employees;

                                                                          Or

ALTER TABLE Student
RENAME to Employees;

 

Now to Access the table you should provide new table name to which it changes i.e., Employees