1, unsigned
When our number types are added to the unsigned, we can store only positive numbers, not negative numbers, and store them in relatively large numbers.
Example:
CREATE Table intint UNSIGNED) ENGINE=Innodb;
INSERT test Value (1, 4); # # OK
INSERT test Value (1,-1); # # Error alert [ERR] 1264-out of range value for column ' B ' at row 1
Note: If we use SELECT b-a from Test here;
[ERR] 1690-bigint UNSIGNED value is out of range in ' (' Test '. ' Test '. ' A '-' test '. ' Test '. ' B ')
It is recommended that you do not use the unsiged attribute easily. Generally we use int to meet the size of the value, if not can use bigint
2, Zerofill
is to give the number type 0 before the number of characters. For example a int (4); A=1; The results show that 0001
Example:
ALTER TABLE COLUMN int (4) UNSIGNED Zerofill; # Add a property to the B field with a zero complement
Then SELELCT * from Test;
MySQL Type properties