类型 |
存储所占空间 (无论显示多少位) (单位 字节/bytes) |
存储数据范围 | 最大显示长度 |
tinyint | 1 |
-128 ~ 127 signed 0 ~ 255 unsigned |
3 |
smaillint | 2 |
-32768 ~ 32767 signed 0 ~ 65535 unsigned |
5 |
mediumint | 3 |
-8388608 ~ 8388607 signed 0 ~ 16777215 unsigned |
7 signed 8 unsigned |
int | 4 |
-2147483648 ~ 2147483647 signed 0 ~ 4294967295 unsigned |
10 |
bigint | 8 |
-9223372036854775808 ~ 9223372036854775807 signed 0 ~ 18446744073709551615 unsigned |
19 signed 20 unsigned |
create table mysql_int ( id int(10) primary key auto_increment, tinyint_a tinyint(3) not null, smallint_b smallint unsigned not null, mediumint_c mediumint(7) not null, bigint_d bigint unsigned not null );