Create table: primary key
/*
mysql> Drop table Orders;
mysql> CREATE TABLE Orders
-> (
-> OrderID SMALLINT UNSIGNED NOT NULL PRIMARY KEY,
-> ModelID SMALLINT UNSIGNED NOT NULL,
-> ModelDescrip VARCHAR(40)
-> );
Query OK, 0 rows affected (0.05 sec)
mysql> Describe Orders;
+--------------+----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+----------------------+------+-----+---------+-------+
| OrderID | smallint(5) unsigned | | PRI | 0 | |
| ModelID | smallint(5) unsigned | | | 0 | |
| ModelDescrip | varchar(40) | YES | | NULL | |
+--------------+----------------------+------+-----+---------+-------+
3 rows in set (0.01 sec)
*/
Drop table Orders;
CREATE TABLE Orders
(
OrderID SMALLINT UNSIGNED NOT NULL PRIMARY KEY,
ModelID SMALLINT UNSIGNED NOT NULL,
ModelDescrip VARCHAR(40)
);
Describe Orders;
Related examples in the same category