1.tinyint
Takes one byte and has a value range of -128~127
unsigned: unsigned, i.e. no negative (0~255)
Used in the representation of Boolean type/weight data
2.int //integral type
Accounted for four bytes
Zerofill: 0 padding without specifying unsigned
3.decimal (m,d) //floating-point
Compared to float, it is more precise
M,d: Total number of digits, number of decimal places
4.char (m) //fixed-length
The value range of M is 0~255
For data that is not long enough, the space is added automatically, although it is wasteful, but faster
5.varchar (m) //variable-length
The value range of M is 0~65535
6.text //text type
Its query speed is slow, try to use char or varchar instead
7.blob //binary type
For storing data such as images, audio, etc.
8.date //Date
Year-month-day range: 1000-01-01~9999-12-31
9.time //Time
Hours: minutes: seconds
10.datetime //Date Time
Year-month-day time: minutes: seconds
11.year //year
Range: 1901~2155 and 0000
12. Precautions
Try to use fixed length type, query efficiency is high; less use varchar, text length
Logon time does not use a datetime type and still uses the int type to store timestamps
@zhnoah
Source: http://www.cnblogs.com/zhnoah/
This article is owned by me and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to the original
The right to pursue legal liability.
MySQL learning note--2. Column type