I need string data types description. Any help?
The string data types include binary and non-binary string data.
The CHAR, VARCHAR, and TEXT data types store non-binary strings (that is, strings of characters that have a character set and collation).
The BINARY, VARBINARY, and BLOB data types are the binary string equivalents of the non-binary CHAR, VARCHAR, and TEXT data types. That is, they store strings that consist of bytes rather than characters, and they have no character set or collation.
The following table summarizes the non-binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.
Type |
Storage Required |
Maximum Length |
CHAR(M) |
M characters |
255 characters |
VARCHAR(M) |
L characters plus 1 or 2 bytes |
65,535 characters (subject to limitations) |
TINYTEXT |
L characters + 1 byte |
255 characters |
TEXT |
L characters + 2 bytes |
65,535 characters |
MEDIUMTEXT |
L characters + 3 bytes |
16,777,215 characters |
LONGTEXT |
L characters + 4 bytes |
4,294,967,295 characters |
The following table summarizes the binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.
Type |
Storage Required |
Maximum Length |
BINARY(M) |
M bytes |
255 bytes |
VARBINARY(M) |
L bytes plus 1 or 2 bytes |
65,535 bytes (subject to limitations) |
TINYBLOB |
L + 1 bytes |
255 bytes |
BLOB |
L + 2 bytes |
65,535 bytes |
MEDIUMBLOB |
L + 3 bytes |
16,777,215 bytes |
LONGBLOB |
L + 4 bytes |
4,294,967,295 bytes |