Use SMALLINT column as the primary key column : SMALLINT « Data Types « MySQL Tutorial






mysql>
mysql> CREATE TABLE myTable
    -> (
    ->    ID SMALLINT UNSIGNED NOT NULL PRIMARY KEY,
    ->    Description VARCHAR(40)
    -> );
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql> desc myTable;
+-------------+----------------------+------+-----+---------+-------+
| Field       | Type                 | Null | Key | Default | Extra |
+-------------+----------------------+------+-----+---------+-------+
| ID          | smallint(5) unsigned | NO   | PRI |         |       |
| Description | varchar(40)          | YES  |     | NULL    |       |
+-------------+----------------------+------+-----+---------+-------+
2 rows in set (0.01 sec)

mysql>
mysql> drop table myTable;
Query OK, 0 rows affected (0.00 sec)








10.20.SMALLINT
10.20.1.SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
10.20.2.Insert value to SMALLINT column
10.20.3.Set up default value for SMALLINT
10.20.4.Use SMALLINT column as the primary key column