mysql database basic types

BIGINT : Integer data from -2 ^ 63 (-9223372036854775808) to 2 ^ 63-1 (9223372036854775807) (all numbers). The storage size is 8 bytes. So when construction of the table can only be bigint (20), even if you build bigint (100), he was 20 biggest so much.

PSbigint has a length, length in mysql table construction, the number of bits only for display

int: from -2 ^ 31 (2,147,483,648) to 2 ^ 31--1 (2,147,483,647) integer data (all numbers). Storage size is 4 bytes. int synonyms of SQL-92 is integer. So when construction of the table can only be int (10), even if you build int (100), he was 10 biggest so much.

smallint The: ^ 15 from -2 ^ 15 (-32,768) through 2--1 (32,767) integer data. Storage size is 2 bytes. So when construction of the table can only be smallint (5), even if you build smallint (100), he was five largest so much.

tinyint: Integer data from 0 to 255, storage size is 1 byte. -2 ^ 7-2 ^ 7-1: -128 to 127; so when construction of the table can only be tinyint (3), even if you build tinyint (100), he was three biggest so much.

Guess you like

Origin www.cnblogs.com/deepminer/p/12541203.html