MySQL整数类型
1:类型介绍
整数类型一共有 5 种,包括 TINYINT、SMALLINT、MEDIUMINT、INT(INTEGER)和 BIGINT。
区别如下:
如果在表中插入数据的时候超出了最大范围会报这样的错误:
Out of range value for cloumn ‘f1’ at row 1
8.0版本和5.7版本的不同:
1:都执行下面的代码
create table test_int(
----f1 tinyInt,
----f2 smallInt,
----f3 mediumInt,
----f4 int,
----f5 bigInt
);Desc test_int;
2:得出的表结构展示不同
2.1:5.7版本
f1 — tinyint(4)
f2 — smallint(6)
f3 — mediumint(9)
f4 —