tags:

views:

52

answers:

2

what is the maximum value allowed for tinyint(2) ?

Is the maximum above allowed value 255 or 99 ? I am confused because (2) after tinyint(2) denotes only the display....am I correct ?

+3  A: 

MySQL 5.0 Reference Manual: Numeric Types

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.

Etc, etc. Lots of good stuff in there.

Edit: No. Note that UNSIGNED is a non-standard attribute that affects the range. Neither value given in your question is the correct upper-limit of a normal TINYINT(2).

Edit for the comment edit: Trust the documentation unless there is a reason not to. If something seems fishy, TIAS (try it and see).

pst
so you guys mean that 127 is the maximum allowed value here ?
What is the correct answer for this ?
Yes, 127 is the maximum value for signed tinyint. Btw, is it so difficult to try?
zerkms
+1  A: 

It takes 127.

refer link : http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html

seed_of_tree