[Novalug] further questions on learning MySQL on ubuntu

Jeff Stoner leapfrog@freeshell.org
Fri Dec 17 10:38:02 EST 2010


On Thu, 16 Dec 2010, Andrew Beals wrote:

> For MySQL, TINYINT(##) interprets ## as the number of bits to use.    In her

No, it does not. From chapter 10 of the manual:

For example, INT(4) specifies an INT with a display width of four 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. [...] The display width does not constrain 
the range of values that can be stored in the column. Nor does it prevent 
values wider than the column display width from being displayed correctly. 
For example, a column specified as SMALLINT(3) has the usual SMALLINT 
range of -32768 to 32767, and values outside the range permitted by three 
digits are displayed in full using more than three digits.


--Jeff

"You cannot unsay a cruel word." - Unknown




More information about the Novalug mailing list