Create table : Create Table : Table Index SQL / MySQL


SQL / MySQL » Table Index » Create Table »

 

Create table



/*
mysql> Drop table Inventory;
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE TABLE Inventory
    -> (
    ->    ID SMALLINT UNSIGNED,
    ->    Name VARCHAR(40),
    ->    Photo BLOB,
    ->    Quantity INT UNSIGNED
    -> );
Query OK, 0 rows affected (0.04 sec)

mysql> Describe Inventory;
+----------+----------------------+------+-----+---------+-------+
| Field    | Type                 | Null | Key | Default | Extra |
+----------+----------------------+------+-----+---------+-------+
| ID       | smallint(5) unsigned | YES  |     | NULL    |       |
| Name     | varchar(40)          | YES  |     | NULL    |       |
| Photo    | blob                 | YES  |     | NULL    |       |
| Quantity | int(10) unsigned     | YES  |     | NULL    |       |
+----------+----------------------+------+-----+---------+-------+
4 rows in set (0.01 sec)


*/

Drop table Inventory;

CREATE TABLE Inventory
(
   ID SMALLINT UNSIGNED,
   Name VARCHAR(40),
   Photo BLOB,
   Quantity INT UNSIGNED
);

Describe Inventory;

           
       



Leave a Comment / Note


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

Follow Navioo On Twitter

SQL / MySQL

 Navioo Table Index
» Create Table