MySQL Datatypes
MySQL Datatypes
MySQL DataTypes
Page 1
Sheet1
Notes:
Based on MySQL version 5.0.
* Storage will be # Of characters or bytes, Plus byte(s) To record length.
** These String data types are NOT case sensitive, Unless given the "binary" Attribute or have a case-
sensitive CHARACTER SET collation.
"E" Is an abbreviation for "exponent". E18 means move the decimal over 18 places (search "scientific
notation").
SERIAL DEFAULT VALUE attribute is an alias for "AUTO_INCREMENT NOT NULL UNIQUE".
SERIAL data type is a synonym for "BIGINT UNSIGNED AUTO_INCREMENT NOT NULL UNIQUE".
BOOL and BOOLEAN data types are synonyms for TINYINT(1).
REAL[(M,D)] And DOUBLE PRECISION[(M,D)] Datatypes are synonyms for DOUBLE[(M,D)].
REAL_AS_FLOAT system variable can make REAL[(M,D)] A synonym for FLOAT[(M,D)].
"UNSIGNED ZEROFILL" Attributes: ZEROFILL means if you specify an M value for an integer, It will be
padded with zeros to fill up the M spaces. Ex: M=6, Integer=247, Display="000247". UNSIGNED means no
negative values and often expands your range.
Corresponding non-binary and binary string types:
CHAR vs. BINARY
VARCHAR vs. VARBINARY
TEXT vs. BLOB
Page 2