Copy a table
mysql>
mysql> CREATE TABLE IF NOT EXISTS TEAMS
-> (TEAMNO INTEGER NOT NULL PRIMARY KEY,
-> EmployeeNO INTEGER NOT NULL,
-> DIVISION CHAR(6) NOT NULL);
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql>
mysql>
mysql> CREATE TABLE TEAMS_COPY2 AS
-> (SELECT *
-> FROM TEAMS);
mysql>
mysql> drop table teams;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table team_copy2;
mysql>
Related examples in the same category