【www.bbyears.com--mysql教程】
select 'bigint unsigned' as type ,Ǝ' as bytes ,~0 as max_num,0 as min_num union
select 'int unsigned',Ɗ',~0>>32,0 union
select 'mediumint unsigned',Ɖ',~0>>40,0 union
select 'smallint unsigned',ƈ',~0>>48,0 union
select 'tinyint unsigned',Ƈ',~0>>56,0 union
select 'signed bigint',Ǝ',~0>>1,-(1<<
word">63
) union
select 'signed int',Ɗ',~0>>33,-(1<<
word">31
) union
select 'signed mediumint',Ɖ',~0>>41,-(1<<
23
) union
select 'signed smallint',ƈ',~0>>49,-(1<<
15
) union
select 'signed tinyint',Ƈ',~0>>57,-(1<<7);
+--------------------+-------+----------------------+----------------------+
| type | bytes | max_num | min_num |
+--------------------+-------+----------------------+----------------------+
| bigint unsigned | 8 | 18446744073709551615 | 0 |
| int unsigned | 4 | 4294967295 | 0 |
| mediumint unsigned | 3 | 16777215 | 0 |
| smallint unsigned | 2 | 65535 | 0 |
| tinyint unsigned | 1 | 255 | 0 |
| signed bigint | 8 | 9223372036854775807 | -9223372036854775808 |
| signed int | 4 | 2147483647 | -2147483648 |
| signed mediumint | 3 | 8388607 | -8388608 |
| signed smallint | 2 | 32767 | -32768 |
| signed tinyint | 1 | 127 | -128 |
+--------------------+-------+----------------------+----------------------+
rows in set (0.00 sec)