Numeric Column Types

MySQL can represent both integers (numbers with no fractional part) and floating-point numbers (those with a fractional part).

Table 5.1 shows the numeric column types.

Table 5.1. Numeric Display Formats
Type NameRangeStorage Required
TINYINTsigned: -128 to 127 
 unsigned: 0 to 2551 byte
SMALLINTsigned: -32768 to 32767 
 unsigned: 0 to 655352 bytes
MEDIUMINTsigned: -8388604 to 8388607 
 unsigned: 0 to 167772153 bytes
INTsigned: -2147483648 to 2147483647 (-231 to 231-1) 
 unsigned: 0 to 4294967295 (0 to 232-1)4 bytes
BIGINTsigned: -263 to 263-1 
 unsigned: 0 to 264-18 bytes
FLOATminimum non-zero: ±1.175494351E-38 
 maximum: ±3.402823466E+384 bytes
DOUBLEminimum non-zero: ±2.2250738585072014E-308 
 maximum: ±1.7976931348623157E+3088 bytes ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.