Create table : Create Table : Table Index SQL / MySQL


SQL / MySQL » Table Index » Create Table »

 

Create table



/*
mysql> Drop table Orders;

mysql> CREATE TABLE Orders
    -> (
    ->    ID SMALLINT UNSIGNED NOT NULL,
    ->    ModelID SMALLINT UNSIGNED NOT NULL,
    ->    Descrip VARCHAR(40),
    ->    PRIMARY KEY (ID, ModelID)
    -> );
Query OK, 0 rows affected (0.06 sec)

mysql> Describe Orders;
+---------+----------------------+------+-----+---------+-------+
| Field   | Type                 | Null | Key | Default | Extra |
+---------+----------------------+------+-----+---------+-------+
| ID      | smallint(5) unsigned |      | PRI | 0       |       |
| ModelID | smallint(5) unsigned |      | PRI | 0       |       |
| Descrip | varchar(40)          | YES  |     | NULL    |       |
+---------+----------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

*/
Drop table Orders;

  
CREATE TABLE Orders
(
   ID SMALLINT UNSIGNED NOT NULL,
   ModelID SMALLINT UNSIGNED NOT NULL,
   Descrip VARCHAR(40),
   PRIMARY KEY (ID, ModelID)
);

Describe Orders;

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

SQL / MySQL

 Navioo Table Index
» Create Table