As per following queries we can copy table structure as well data to another duplicate table in MySQL.
This query will copy the table structure and indexes, but data not copy.
CREATE TABLE new_table LIKE old_table;
This query will copy structure as well as data but indexes are not copy.
CREATE TABLE new_table SELECT * FROM old_table;
This query will copy structure as well as data but indexes are not copy.
CREATE TABLE new_table SELECT * FROM old_table;
Copy the structure, data, indexes, primary key, foreign key constraints and triggers use this query
CREATE TABLE new_table LIKE old_table; INSERT new_table SELECT * FROM old_table; #only data
CREATE TABLE destination_db_name.new_table LIKE source_db_name.old_table; INSERT destination_db_name.new_table SELECT * FROM source_db_name.old_table;
Related
find the nth highest salary in mysql without limit