1. Unsigned is the unsigned number type.
The type range of int is -2147483648~2147483647, and the type range of int unsigned is 0~4294967295
Unsigned can also have negative effects, such as:
CREATE TABLE T (a int unsigned,b int unsigned)
INSERT into T SELECT
What will be the result of SElECT A-B from T, will it be-1, the answer is not sure, in the Mac system will be an error,
The result in the Linux system is 4294967295, so try not to use unsigned, but this is not a bug, you can refer to the MySQL Technical insider explanation
How to get -1 value, as long as the Sql_mode this parameter setting can be
SET sql_mode= ' no_unsigned_subtraction ';
2. Zerofill, if the width is less than the set value is automatically filled 0
ALTER TABLE T Change a A int (4) unsigned zerofill;
Select a from T
Result is 0001
MySQL type properties unsigned and Zerofill