View Full Version : Confused about tinyint,medint,bigint...
iceflyin
08-15-2007, 09:01 AM
Is tinyint only the numbers from 0-127? So the biggest number could be 127???
Or is it 127 numbers in length?
guelphdad
08-15-2007, 01:33 PM
tinyint can be signed (i.e. allow positive and negative numbers) or it can be unsigned allowing positive numbers only.
the length is NOT determined by the data type, but the highest and lowest values are.
Often you will see erroneous things like TINYINT(2) and people expect that means that it can only hold values up to 99. That isn't true, the number has to do with using ZEROFILL.
tinyint can hold values of -128 to 127 OR 0 to 255 if you use unsigned.
See this post (http://www.codingforums.com/showpost.php?p=540233&postcount=6) for more information on data types and what values they can hold.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.