Why is INT (11) when it only stores 10 digits?

I know that the number inside the brackets does not control the storage limit; but I'm curious why it is popular to write INT(11) when it only stores 10 digits (unsigned 4,294,967,295). Using numbers smaller than capacity, such as tinyint(1) , is understandable, but why higher?

+4
source share
3 answers

The value of the integer is 11:10 digits + 1 character

The unsigned integer is 10.

+9
source

This is because 11 counts the digit of the character

+5
source

When working with type INT, the size "size" is the size of the display. INT - 4 bytes.

Additional (10 + 1) for the minus sign. If you make it unsigned int, the default size will be 10, not 11.

There would be no reason to go beyond 11.

+1
source

Source: https://habr.com/ru/post/1401599/


All Articles