📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials MySQL MySQL Data Types

MySQL Data Types

4 min read Quiz at the end
Choose the right MySQL data type: INT for IDs, DECIMAL for money, VARCHAR for strings, JSON for documents.

MySQL Data Types

TypeUse Case
INT / BIGINTIntegers, IDs, counts
TINYINT(1)Boolean (0/1)
DECIMAL(10,2)Money, precise decimals
FLOAT / DOUBLEApproximate decimals
VARCHAR(n)Short strings (max 65535)
TEXTLong text (64KB)
MEDIUMTEXTMedium text (16MB)
DATEYYYY-MM-DD
DATETIMEYYYY-MM-DD HH:MM:SS
TIMESTAMPAuto-updated datetime
JSONJSON documents (MySQL 5.7+)
ENUMFixed set of values
price    DECIMAL(10,2) NOT NULL,
status   ENUM('active','inactive','banned') DEFAULT 'active',
settings JSON,
tags     SET('php','python','js')