Create table : Create Table : Table Index SQL / MySQL


SQL / MySQL » Table Index » Create Table »

 

Create table



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

mysql> CREATE TABLE Product
    -> (
    ->    ID SMALLINT UNSIGNED NOT NULL,
    ->    Name VARCHAR(40) NOT NULL
    -> );
Query OK, 0 rows affected (0.05 sec)

mysql> Describe Product;
+-------+----------------------+------+-----+---------+-------+
| Field | Type                 | Null | Key | Default | Extra |
+-------+----------------------+------+-----+---------+-------+
| ID    | smallint(5) unsigned |      |     | 0       |       |
| Name  | varchar(40)          |      |     |         |       |
+-------+----------------------+------+-----+---------+-------+
2 rows in set (0.00 sec)

*/
Drop table Employee;

CREATE TABLE Employee
(
   ID SMALLINT UNSIGNED NOT NULL,
   YearBorn YEAR NOT NULL,
   CityBorn VARCHAR(40NOT NULL DEFAULT 'Unknown'
);

Describe Employee;

           
       



Leave a Comment / Note


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

Follow Navioo On Twitter

SQL / MySQL

 Navioo Table Index
» Create Table