MYSQL DATA TYPES
MYSQL DATA TYPES
MYSQL DATA TYPES
MySQL there are three main types text, number, and Date/ Time types.
MYSQL DATA TYPES
Text types:
Data type Description
CHAR(size) Â Â Â Â Â Â Â Â Â Â Holds a fixed length
string (can contain
letters, numbers, and
special characters). The
fixed size is specified in
parenthesis.Can store up
To255 characters
VARCHAR(Size)Â Â Â Â Â Â Â Holds a variable length
string (can contain
letters, numbers, and
special characters).The
maximum size is
specified in parenthesis
Can store up to 255
characters.
TINYTEXTÂ Â Â Â Â Â Â Â Holds a string with a
maximum length of 255
characters
TEXT Â Â Â Â Â Â Â Â Â Â Â Â Holds a string with a
maximum length of
65,535 characters
BLOBÂ Â Â Â Â Â Â Â Â Â Â Â For BLOBs (Binary Large
OBjects).Holds up to
                                  65,535 bytes of data
MEDIUMTEXTÂ Â Â Â Â Â Â Â Â Â Â Â Holds a string with a
maximum length of
16,777,215 characters
MEDIUMBLOB Â Â Â Â Â Â Â Â Â Â Â For BLOBs Binary Large
OBjects Hold s up to
16,777.215 bytes of data
LONGTEXTÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Holds a string with a
maximum length of
4,294,967295 characters
LONGBLOB Â Â Â Â Â Â Â Â Â Â Â Â Â For BLOBs (Binary Large
OBjects)Holds up to
                                               4,294,967,295 bytes of data
ENUM(Xx.y.z.etc.) Â Â Â Â Â Â Â Â Â Â Â Â Â Let you enter a list of
possible values. You can
list up to 65535 values in
an ENUM list. If value is
inserted that is not in the
list, a blank value will be
inserted.
Note: The values are
sorted in the order you
enter them.
You enter the possible
values in this format:
ENUM(’X’,Y’,Z’)
SETÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Similar to ENUM except
that SET may contain up
to 64 list items and can
store more than one
choice