Create table : Create Table : Table Index SQL / MySQL


SQL / MySQL » Table Index » Create Table »

 

Create table



/*
mysql> Drop table Bike;

mysql> CREATE TABLE Bike
    -> (
    ->    ID SMALLINT UNSIGNED,
    ->    Model VARCHAR(40),
    ->    Color ENUM('red', 'blue', 'green', 'yellow'),
    ->    Options SET('rack', 'light', 'helmet', 'lock')
    -> );
Query OK, 0 rows affected (0.09 sec)

mysql> Describe Bike;
+---------+-------------------------------------+------+-----+---------+-------+
| Field   | Type                                | Null | Key | Default | Extra |
+---------+-------------------------------------+------+-----+---------+-------+
| ID      | smallint(5) unsigned                | YES  |     | NULL    |       |
| Model   | varchar(40)                         | YES  |     | NULL    |       |
| Color   | enum('red','blue','green','yellow') | YES  |     | NULL    |       |
| Options | set('rack','light','helmet','lock') | YES  |     | NULL    |       |
+---------+-------------------------------------+------+-----+---------+-------+

4 rows in set (0.01 sec)


*/
Drop table Bike;

CREATE TABLE Bike
(
   ID SMALLINT UNSIGNED,
   Model VARCHAR(40),
   Color ENUM('red', 'blue', 'green', 'yellow'),
   Options SET('rack', 'light', 'helmet', 'lock')
);

Describe Bike;


           
       



Leave a Comment / Note


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

Follow Navioo On Twitter

SQL / MySQL

 Navioo Table Index
» Create Table