MySQL

How to Rename a Table in MySQL

In this tutorial, we are going to see how to rename a table in MySQL. The ALTER TABLE statement is used to add, remove or modify columns in an existing table. Here is the syntax to rename a table in MySQL:

ALTER TABLE tableName RENAME TO newTable;

 

 

How to Rename a Table in MySQL

The following query renames the “users” table to “employees”.

ALTER TABLE users RENAME TO employees;
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *