There might be a circumstance when you need a precise of a table and CREATE TABLE ... SELECT doesn't exactly measure up for your motivations in light of the fact that the duplicate should incorporate the equivalent lists, default esteems, etc.
You can deal with the present circumstance by following advances −
Use SHOW CREATE TABLE to get a CREATE TABLE explanation that determines the source table's design, lists what not.
Adjust the assertion to change the table name to that of the clone table and execute the assertion. Thusly, you will have accurate clone table.
Alternatively, on the off chance that you need the table substance duplicated too, issue an INSERT INTO ... SELECT articulation, as well.
Example
Evaluate the accompanying guide to make a clone table for tutorials_inf.
Step 1
Get total construction about table.
mysql> SHOW CREATE TABLE tutorials_inf \G;
*************************** 1. row ***************************
Table: tutorials_inf
Create Table: CREATE TABLE `tutorials_inf` (
`id` int(11) NOT NULL,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `AUTHOR_INDEX` (`name`),
UNIQUE KEY `NAME_INDEX` (`name`),
KEY `id` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = latin1
1 row in set (0.05 sec)
ERROR: No query specified
Step 2
Rename this table and make another table.
mysql> CREATE TABLE tutorials_clone(
-> id int(11) NOT NULL,
-> name varchar(20) NOT NULL,
-> PRIMARY KEY (id),
> UNIQUE KEY AUTHOR_INDEX (name),
-> UNIQUE KEY NAME_INDEX (name),
-> KEY id (id));
Query OK, 0 rows affected (1.80 sec)
Step 3
In the wake of executing stage 2, you will make a clone table in your information base. In the event that you need to duplicate information from old table, at that point you can do it by utilizing INSERT INTO... SELECT proclamation.
mysql> INSERT INTO tutorials_clone(id,name) SELECT id,name from tutorials_inf;
Query OK, 4 rows affected (0.19 sec)
Records: 4 Duplicates: 0 Warnings: 0
At long last, you will have accurate clone table as you needed to have.