some typical people will ask those questions in the interviews, first of all they dont know & try to get from us.
instead of showing odd face, we can give exact know.
thanks.
MySQL supports and extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT(4) specifies an INT with a display with of 4 digits. This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)
So, the number has nothing to do with the range of values the column can contain. It is extra info that may be used by the application that extracts the data. May, or may not.
The number of digits you specify for an int only makes a difference if you also specify a fill character as then if the length to be displayed is shorter than the length you specify it will pad it out using the fill character
eg int(4) fill(‘*’) with a value of 100 will return *100 from any database call.
If you create an INT(1) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(2) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(3) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(4) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(5) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(6) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(7) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(8) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(9) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(10) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
If you create an INT(11) the minimum value for that field is -2147483648 and the maximum value for that field is 2147483647.
I really don’t know how to make it any more clear than that …
i read the manual, sorry to say i didn’t get exact answer what i need.
my question is “how many number of digits allowed for length 3 given to integer column”.