Create table : Create Table : Table Index SQL / MySQL


SQL / MySQL » Table Index » Create Table »

 

Create table



/*
mysql> Drop table Employee;

mysql> CREATE TABLE Employee
    -> (
    ->    ID SMALLINT UNSIGNED NOT NULL,
    ->    YearBorn YEAR NOT NULL,
    ->    CityBorn VARCHAR(40) NOT NULL DEFAULT 'Unknown'
    -> );
Query OK, 0 rows affected (0.11 sec)

mysql> Describe Employee;
+----------+----------------------+------+-----+---------+-------+
| Field    | Type                 | Null | Key | Default | Extra |
+----------+----------------------+------+-----+---------+-------+
| ID       | smallint(5) unsigned |      |     | 0       |       |
| YearBorn | year(4)              |      |     | 0000    |       |
| CityBorn | varchar(40)          |      |     | Unknown |       |
+----------+----------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)


*/
Drop table Shelf;
  
CREATE TABLE Shelf
(
   ID SMALLINT UNSIGNED NOT NULL,
   YearBorn YEAR NOT NULL,
   NumBooks SMALLINT NOT NULL DEFAULT 1
);

Describe Shelf;
           
       



Leave a Comment / Note


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

Follow Navioo On Twitter

SQL / MySQL

 Navioo Table Index
» Create Table