Integer type:
| Type |
Number of bytes |
Default display width |
| TINYINT |
1 |
4 |
| SMALLINT |
2 |
6 |
| Mediumint |
3 |
9 |
| Int |
4 |
11 |
| INTEGER |
4 |
11 |
| BIGINT |
8 |
20 |
Zerofill parameter: The digital display space is filled by the decimal, can only represent the unsigned number
The setting display width is invalid when the actual width of the data is greater than the setting display width, but the actual width of the data cannot be greater than the default display width
Integer types can be self-increasing.
Floating-point type and fixed-point number type:
are used to denote decimals
| Type |
Number of bytes |
| FLOAT |
4 |
| DOUBLE |
8 |
| DECIMAL (M,D) |
M+2 |
Data type (M,D): Total length of M data D length after decimal point
When rounding, FLOAT and double do not error, decimal will have warning
Fixed-point numbers are stored as strings
Date and Time type
MySQL Learning notes-data types