CHAR(size) |
- It is used to define a fixed length String that can contain letters, numbers, and special characters.
- The size can be from 0 to 255 characters. The default size is 1.
|
VARCHAR(size) |
- It used to define a variable length String that can contain letters, numbers, and special characters.
- The size can be from 0 to 65535 characters.
|
BINARY(size) |
- It is equivalent to CHAR(), but stores binary byte strings.
- The size parameter specifies the column length in bytes. The default size is 1.
|
VARBINARY(size) |
- It is equivalent to VARCHAR(), but stores binary bytes strings.
- The size parameter specifies the maximum column length in bytes.
|
TEXT(size) |
- It holds a String.
- The maximum length is 65,535 bytes.
|
TINYTEXT |
- It holds a String.
- The maximum size is 255 characters.
|
MEDIUMTEXT |
- It holds a String.
- The maximum length is 16,777,215 characters.
|
LONGTEXT |
- It holds a String.
- The maximum length is 4,294,967,295 characters.
|
BLOB(size) |
- It is used for BLOBs (Binary Large Objects).
- It can hold up to 56,535 bytes of data.
|
MEDIUMBLOB |
- It is used for BLOBs (Binary Large Objects).
- It can hold up to 16,777,215 bytes of data.
|
LONGBLOB |
- It is used for BLOBs (Binary Large Objects).
- It can hold up to 4,294,967,256 bytes of data.
|
ENUM(val1, val2, val3, ...) |
- It is used when a String object can only have one value, chosen from a list of possible values.
- It can contain up to 65,535 values in an ENUM list.
- If you insert a value that is not in the list, a blank value will be inserted.
- The values are sorted in the order you enter them.
|
SET(val1, val2, val3, ...) |
- It is used to specify a String that can have 0 or more values, chosen from a lit of possible values.
- It can hold up to 64 values.
|