• Ask a Question
  • Create a Poll
150
Insert Image Size must be less than < 5MB.
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel
      1 Answers

      MySQL offers two ways to rename tables. The first one uses the ALTER TABLE syntax:

      ALTER TABLE old_table_name RENAME new_table_name;

      The second way is to use RENAME TABLE

      RENAME TABLE old_table_name TO new_table_name;

      RENAME TABLE offers more flexibility. It allows renaming multiple tables in one statement. This can be useful when replacing a table with a new pre-populated version:

      RENAME TABLE products TO products_old, products_new TO products;

      The above statement is executed left to right, so there’s no conflict naming products_new to products since the existing table has already been renamed to products_old.

      Answered by Munna Kumar on September 6, 2021..