CREATE TABLE TEAMS_COPY1 LIKE TEAMS : Create Table « Table Index « SQL / MySQL






CREATE TABLE TEAMS_COPY1 LIKE TEAMS

        
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.00 sec)

mysql>
mysql>
mysql> CREATE TABLE TEAMS_COPY1 LIKE TEAMS;

mysql>
mysql>
mysql> drop table teams;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Create Simple Tables
2.Create table: default value for column
3.Create table: small int and unsigned int
4.Create table: smallint, decimal and float
5.Create table: char, varchar
6.Create table: BLOB
7.Create table: char set and language
8.Create table: ENUM and set
9.Create table: YEAR and TIMESTAMP
10.Create table: null and not null
11.Create table: not null and default value
12.Create table: default int value
13.Create table: primary key
14.Create table: primary key 2
15.Create table: two columns for primary key
16.Create table: auto increment primary key
17.Create table: REFERENCES
18.Create table: foreign key
19.Create table: engine type INNODB
20.Set average row length and max, min rows
21.Syntax for Creating Tables (CREATE TABLE)
22.Create an empty table, use a WHERE clause that is always false
23.To produce a summary that includes all hours of the day, create a reference table that lists each hour
24.Creates table-level privileges.
25.Create a copy of the product table:
26.Create a table called cust_names using the table definitions and data from the product table.
27.CREATE TABLE IF NOT EXISTS
28.Creating Copies of a Table
29.Creating a New Table by Copying
30.Creating a Table
31.Add an IF NOT EXISTS clause to the statement: