Mega Code Archive

 
Categories / MySQL / Data Type
 

Numeric Column Types

mysql> mysql> CREATE TABLE test1(id TINYINT ZEROFILL); Query OK, 0 rows affected (0.00 sec) mysql> mysql> INSERT INTO test1 VALUES(3); Query OK, 1 row affected (0.00 sec) mysql> mysql> INSERT INTO test1 VALUES (-1); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> mysql> INSERT INTO test1 VALUES (256); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> mysql> SELECT * from test1; +------+ | id   | +------+ |  003 | |  000 | |  255 | +------+ 3 rows in set (0.00 sec) mysql> mysql> drop table test1; Query OK, 0 rows affected (0.00 sec)