MySQL Data Types

MySQL column data types

Numeric Types

TINYINT # -128 to 127 (1 byte)
SMALLINT # -32768 to 32767 (2 bytes)
INT # -2147483648 to 2147483647 (4 bytes)
BIGINT # very large integers (8 bytes)
DECIMAL(10,2) # fixed-point (10 digits, 2 decimals)
FLOAT # floating-point (4 bytes)
DOUBLE # double precision (8 bytes)

String Types

CHAR(10) # fixed-length string
VARCHAR(255) # variable-length string
TEXT # up to 65,535 characters
MEDIUMTEXT # up to 16MB
LONGTEXT # up to 4GB

Date and Time

DATE # YYYY-MM-DD
TIME # HH:MM:SS
DATETIME # YYYY-MM-DD HH:MM:SS
TIMESTAMP # unix timestamp
YEAR # year in 4-digit format

Binary Types

BINARY(16) # fixed-length binary
VARBINARY(255) # variable-length binary
BLOB # binary large object

Other Types

ENUM('small', 'medium', 'large') # enumeration
SET('read', 'write', 'execute') # set of values
JSON # JSON data
BOOLEAN # alias for TINYINT(1)