The number after int has nothing to do with space usage and execution efficiency.
It is only used for display format, that is, when the field is set to ZEROFILL.
When used in conjunction with ZEROFILL, the default supplementary spaces are replaced with zeros.
Without ZEROFILL, this number is meaningless.
As for why it is int(11), not int(10).
Because for example, -2147483648 or something is 11, and if UNSIGNED is set, it will be 10.
int occupies 4 bytes. If it is unsign, the storage range is 0 - 4294967295
int The following numbers will not affect storage and have no impact on the actual stored value. No matter what the following number is, it has no practical effect. A int only occupies four bytes.
only works when displayed on the client and must have the zerofill attribute.
The number after int has nothing to do with space usage and execution efficiency.
It is only used for display format, that is, when the field is set to
ZEROFILL
.When used in conjunction with
ZEROFILL
, the default supplementary spaces are replaced with zeros.Without
ZEROFILL
, this number is meaningless.As for why it is int(11), not int(10).
Because for example,
-2147483648
or something is 11, and ifUNSIGNED
is set, it will be 10.int
occupies 4 bytes. If it isunsign
, the storage range is 0 - 4294967295int
The following numbers will not affect storage and have no impact on the actual stored value. No matter what the following number is, it has no practical effect. Aint
only occupies four bytes.only works when displayed on the client and must have the
zerofill
attribute.