Integer type:
tinyint, smallint, mediumint, int, bigint respectively use 8, 16, 24, 32, 64-bit storage space, in the case of ensuring that the storage value is sufficient, select the smallest data type
Real type (when a fractional part is included):
Decimal
String type:
VarChar type stores variable length strings
Char stores fixed-length string performance up to char (1) to store t/f Boolean
Date and Time type:
DateTime can hold a wide range of values 1001 to 9999 he encapsulates the date and time into a YYYYMMDDHHMMSS integer that is independent of the time zone use 8 bytes of storage space
Timestamp saved the number of milliseconds since midnight January 1, 1970 to 2038 storage values will typically change depending on the time zone should be used as much as possible timestamp than datetime performance
Special types of data:
Timestamp YYYYMMDDHHMMSS general use of int storage can be converted to a time type with from_unixtime function as a high efficiency
The IP address is generally stored in int (10) Inet_aton () ip-> digital Inet_ntoa () digital->ip
Mysql Build table data type selection