数值类型又分为整数型与小数型
整数型下面的表显示了需要的每个整数类型的存储和范围
创建一张表
mysql> CREATE TABLE t_int ( int_1 TINYINT, int_2 SMALLINT, int_3 MEDIUMINT, int_4 INT, int_5 BIGINT); Query OK, 0 rows affected mysql> DESC t_int; +-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | int_1 | tinyint(4) | YES | | NULL | | | int_2 | smallint(6) | YES | | NULL | | | int_3 | mediumint(9) | YES | | NULL | | | int_4 | int(11) | YES | | NULL | | | int_5 | bigint(20) | YES | | NULL | | +-------+--------------+------+-----+---------+-------+ 5 rows in set