Skip to main content

A very common question regarding integer datatype in MySQL is: "Are INT(1) and INT(10) the same?" or "What is difference between INT(1) and INT(10)?"

The answer is YES, they are actually exactly the same!

An unsigned int uses 4 bytes of data and it has the max value of 4294967295. It doesn't matter whether it is represented as INT(1) or INT(10)

What does the number in the brackets mean?

The number inside brackets is called the display width. It represents a number between 1 and 255 and you can set it for determing how many ciphers will be displayed, e.g. int(1) will display only one cipher, int(3) will display 3 ciphers.

The display width is not related to fields length and how many bytes of data will be used for data storage. It only represents display width, nothing else. If you, however, would like to use different amount of bytes you need to choose a proper datatype; for example if you will not use values above 127 and -128, you should use a tinyint.

- Advertisement -
- Advertisement -