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


MySQL TUTORIALS » Data Types » TINYINT »

 

TINYINT[(M)] [UNSIGNED] [ZEROFILL]


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(50NOT NULL
    -> );
Query OK, rows affected (0.03 sec)

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

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

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

mysql>
mysql>
mysql>



Leave a Comment / Note


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

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» TINYINT