MySQL Data Type
Text
CHAR (*): a fixed-length string of up to 255 bytes. Its length must be specified at creation.
VARCHAR (*): a variable-length string of up to 255 bytes. Its length must be specified at creation.
TEXT: variable-length TEXT with a maximum length of 64 k characters
TINYTEXT: variable-length text up to 255 characters
MEDUIMTEXT: variable-length text with a maximum length of 16 k characters
LONGTEXT: variable-length text with a maximum length of 4 GB
INTEGER (select the smallest possible type after considering the data value)
Tinyint: 1 byte. Signed value:-128 to 127; unsigned value: 0 to 255
Smallint: 1 byte. Signed value:-32768 to 32767; unsigned value: 0 to 65535
Mediumint: 3 bytes.
Int: 4 bytes
Bigint: 8 bytes
Decimal places (length and decimal places are required, that is, the display width and decimal places)
Decimal: Precisely stores decimals. It is internally stored using strings. It is suitable for exact types such as amount. Alias: NUMERIC
Float: 4 bytes, single precision. Approximate storage (*), which is more efficient than decimal.
Double: 8 bytes, double precision. Approximate storage (*), which is more efficient than decimal.
Date and Time
DATE: 4 bytes. Range: 1000-01-01--9999-12-31
TIME: 3 bytes. Range:-838: 59: 59--838: 59: 59
DATETIME: 8 bytes. Value Range: 1000-01-01 00:00:00 -- 9999-12-31 23:59:59
Binary Big Data
TITYBLOB: the maximum length is 255 bytes.
BLOB: the maximum length is 64 KB.
MEDIUMBLOB: the maximum length is 16 MB.
LONGBLOB: the maximum length is 4 GB.