Integer Types in MySQL with Sizes and Ranges : Integer Type « Data Type « SQL / MySQL






Integer Types in MySQL with Sizes and Ranges

   
+--------------+-------+---------------------------+----------------+ 
|Integer Type  | Bytes | Signed                    |Unsigned        |
+--------------+-------+---------------------------+----------------+ 
|TINYINT       | 1     | -128 through 127          | 0 through 255  |
+--------------+-------+---------------------------+----------------+ 
|SMALLINT      | 2     |-32,768 through 32,767     |0 through 65,535|
+--------------+-------+---------------------------+----------------+ 
|MEDIUMINT     | 3     |-8,338,608 through         |0 through       |
|              |       |    8,388,607              |    16,777,215  | 
+--------------+-------+---------------------------+----------------+ 
|INT           | 4     |-2,147,483,648             |0 through       |
|              |       |through 2,147,483,487      |  4,294,967,295 |
+--------------+-------+---------------------------+----------------+ 
|BIGINT        |8      |-9,223,372,036,854,775,808 |0 through       |
|              |       |through                  |18,446,744,073,709,551,615
|              |       |9,223,372,036,854,775,807  |                |
+--------------+-------+---------------------------+----------------+ 
  


           
         
    
    
  








Related examples in the same category

1.Int value: less than and equal
2.Int value: larger and equals
3.Int value: less than
4.Int value: bigger
5.INT(m), INTEGER(m): 32-bit integer (4 bytes, -2.147,483,648 to +2,147,483,647)
6.Number Data types in MySQL
7.Compare with integer literal
8.Minus a constant value