size of tinyint(1)

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ranjitbd
Forum Newbie
Posts: 24
Joined: Sun May 03, 2009 1:59 pm

size of tinyint(1)

Post by ranjitbd »

unsigned tinyint(3) can take maximum value 256.....
if a table id(which is primary key and auto increment) is set data type tinyint(1)
then what will be the maximum value for the id?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: size of tinyint(1)

Post by onion2k »

255 if it's unsigned. The column size (and thus maximum number that can be stored) isn't affected by the number in the brackets - that number is the display width. http://dev.mysql.com/doc/refman/5.0/en/ ... types.html
Post Reply