These datatypes are case-sensitive.
So, lowercase and uppercase letters remain unchanged when stored or
retrieved. For a few of the string datatypes, a maximum column width
may be specified. If a string is entered in a column that exceeds the
width set for the column, the string will be right-truncated when
CHAR datatype is a fixed-width column.
Columns are right-padded with spaces when stored. The
VARCHAR datatype adjusts its width and does not
pad the strings stored. Any trailing spaces contained in a string
that is stored are removed.
As of Version 4.1 of MySQL, the
ASCII attribute may be specified for use with the
CHAR datatype. This will set the column to the
latin1 character set. As of Version 4.1 of MySQL,
UNICODE attribute may be specified for use
CHAR datatype. This will set the column
ucs2 character set.
VARBINARY datatypes store data as binary strings
and not character strings like
CHAR. Table A-4 lists the various types and their maximum
sizes. Some types are listed together:
(Binary Large Object) and
TEXT. They have the same
maximum value, but
TEXT-type columns are handled
based upon their character set, whereas
are not; they’re handled as binary strings. This
becomes a factor in sorting and comparing data. Binary strings are
case-sensitive. As of Version 4.1 of MySQl, you can assign a
character set to a
TEXT type of column. Values are sorted based on the collation of the character set for ...