MySQL uses many different data types, generally divided into three categories: number, date, time, and string type, and the corresponding data types are described below
1, numeric data type
INT-A normal-sized integer that can be signed. If it is signed, it is allowed to range from 2147483648 to 2147483647. If it is unsigned, the allowable range is from 0 to 4294967295. You can specify a width of up to 11 bits.
TINYINT-A very small integer that can be signed. If it is signed, it allows a range from 128 to 127. If it is unsigned, the allowable range is from 0 to 255, you can specify a width of up to 4 digits.
SMALLINT-A small integer that can be signed. If there are symbols, the allowable range is 32768 to 32767. If unsigned, the allowable range is from 0 to 65535, you can specify a width of up to 5 bits.
Mediumint-a medium-sized integer that can be signed. If there are symbols, the allowable range is 8388608 to 8388607. If unsigned, the allowable range is from 0 to 16777215, you can specify a width of up to 9 bits.
BIGINT-A large integer that can be signed. If there are symbols, the allowable range is 9223372036854775808 to 9223372036854775807. If unsigned, the allowable range is from 0 to 18446744073709551615. You can specify a width of up to 20 bits.
Float (m,d)-unsigned floating-point numbers cannot be used. You can define the display length (M) and the number of decimal digits (D). This is not required, and the default is 10, 2. Where 2 is the number of decimal places, and 10 is the total number of digits (including decimals). Decimal precision can be up to 24 floating-point.
Double (m,d)-unsigned double-precision floating-point numbers cannot be used. You can define the display length (M) and the number of decimal digits (D). This is not required, the default is 16, 4, where 4 is the number of decimal places. Decimal precision can reach a double of 53 bits. Real is a double synonym.
DECIMAL (M,D)-the non-compressed floating-point number cannot be unsigned. After unpacking the decimal, each decimal corresponds to one byte. It is necessary to define the display length (M) and the number of decimals (D). Numeric is a synonym for decimal.
2, date and time type
Date-dates in YYYY-MM-DD format, between 1000-01-01 and 9999-12-31. For example, December 30, 1973 will be stored as 1973-12-30.
DateTime-Date and time combination in YYYY-MM-DD HH:MM:SS format, between 1000-01-01 00:00:00 to 9999-12-31 23:59:59. For example, December 30, 1973 3:30, will be stored as 1973-12-30 15:30:00.
TIMESTAMP-1970 the time stamp between midnight January 1, at some point in the year 2037. This looks like the preceding datetime format, without just the hyphen between the numbers; December 30, 1973 3:30 P.M. will be stored as 19731230153000 (YYYYMMDDHHMMSS).
Time-stored in HH:MM:SS format.
Year (M)-Stores the years in 2-bit or 4-bit numeric format. If the length is specified as 2 (for example, year (2)), the years can be 1970 to 2069 (70?69). If the length is specified as 4, the year range is 1901-2155 and the default length is 4.
3, String type
CHAR (M)-a fixed-length string is a length of 1 to 255 characters long (for example: CHAR (5)) and the right space is stored to fill the specified length. The limit length is not required, it defaults to 1.
VARCHAR (M)-variable-length string is the number of characters between 1 and 255 in length (higher version of MySQL is more than 255); For example: VARCHAR (25). When you create a varchar type field, you must define a length.
The maximum length of a BLOB or TEXT-field is 65,535 characters. BLOBs are "binary large objects" and are used to store large binary data, like or other types of files. Defined as text field also holds a large amount of data; The difference between the two is that sorting and comparing the data stored on the BLOB is case sensitive, while the text field is case insensitive. You do not specify the length of the blob or text.
Tinyblob or Tinytext-blob or text column with a maximum length of 255 characters. The length of Tinyblob or tinytext is not specified.
Mediumblob or Mediumtext-blob or the text column has a maximum length of 16777215 characters. The length of Mediumblob or mediumtext is not specified.
The Longblob or Longtext-blob or text column has a maximum length of 4294967295 characters. The length of Longblob or longtext is not specified.
Enum-enumeration, which is a peculiar list of terms. When defining an enum, to create a list of its values, these are the items that must be used for the selection (or it can be null). For example, if you want a field to contain "a" or "B" or "C", you can define the enum as an enum ("A", "B", "C") and only those values (or null) to fill this field.
Article from (www.huthon.com)
MySQL table field type which