TINYINT[(M)] [UNSIGNED] [ZEROFILL] : TINYINT « Data Types « MySQL Tutorial






A very small integer.

The signed range is -128 to 127.

The unsigned range is 0 to 255.

mysql>
mysql>
mysql> CREATE TABLE myTable(
    ->    ID TINYINT UNSIGNED NOT NULL DEFAULT 1,
    ->    Name VARCHAR(50) NOT NULL
    -> );
Query OK, 0 rows affected (0.03 sec)

mysql>
mysql>
mysql> INSERT INTO myTable (Name)VALUES ('A');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> select * from myTable;
+----+------+
| ID | Name |
+----+------+
|  1 | A    |
+----+------+
1 row in set (0.00 sec)

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

mysql>
mysql>
mysql>








10.25.TINYINT
10.25.1.TINYINT[(M)] [UNSIGNED] [ZEROFILL]
10.25.2.Insert value to TINYINT column