The numeric data types in MySQL include the following:
- INT: An INT value can range from -2147483648 to 2147483647. An INT can only store whole numbers. It can't store numbers with decimal places. Any value you try to place with decimal places will be rounded up or down depending on the decimal value. If you try to store a number outside the range, the number won't be stored, and you will receive an error.
| Value to insert |
INT value |
| 12.34 |
12 |
| 12.76 |
13 |
INT values can be signed or unsigned. Unsigned only stores positive numbers and signed ones can store both positive and negative numbers.
Unsigned doesn't affect the size of the column, but just shifts the range to only positive numbers. Use unsigned ...