How to duplicate a table with keys & other structure features retained? including primary key, foreign keys, and indexes.
Can this be done with a single MySQL query?
you can do it in this query
CREATE TABLE a LIKE b
after you can insert
INSERT INTO a SELECT * FROM b
read more information in this article