Insert value to SMALLINT column : SMALLINT « Data Types « MySQL Tutorial






mysql>
mysql> CREATE TABLE myTable(
    ->    ID SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    ->    Name VARCHAR(50) NOT NULL
    -> );
Query OK, 0 rows affected (0.06 sec)

mysql>
mysql>
mysql> INSERT INTO myTable (ID, Name)VALUES (1, 'Ain\'t ');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> select * from myTable;
+----+--------+
| ID | Name   |
+----+--------+
|  1 | Ain't  |
+----+--------+
1 row in set (0.01 sec)

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

mysql>
mysql>
mysql>








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