MySQL Self-study 2018/05/02 - Numerical Types

1. Strict numeric types (INTEGER=INT, SMALLINT, DECIMAL=DEC, NUMERIC)

int(5): Indicates that when the width of the value is less than 5 digits, fill the width in front of the number, the default is int(11), generally used with zerofill

unsigned: Store a non-negative number in the field. Value range: the lower limit is 0, and the upper limit is 2 times the original value.

1 alter table t1 modify id1 int(5) zerofill;

 

2. Approximate numeric data types (FLOAT, REAL, DOUBLE, PRECISION)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325128296&siteId=291194637