Looking for help in creating a Mysql query to copy the structure of an existing table to create another table.
To export data to an existing table you can use insert command. This will create a new table student2 using the structure of the table student and will copy all the records from table student to our new table student2. This became more useful when we add conditions to this by using SQL WHERE command.
What command is used to create a table by copying the structure of another table? CREATE TABLE As SELECT Command. Explanation: To copy only the structure the where clause of the SELECT command should have a FALSE statement.
To create a table as in an exact replica of another table:
CREATE TABLE `new_table_name` LIKE `old_table_name`;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With