Lesson 4 / 30
Data Types
Pick the right MySQL column types for whole numbers, exact money values, text, dates and booleans.
Numbers & text
Common types: INT for whole numbers, DECIMAL(p,s) for exact money values, VARCHAR(n) for variable-length text, TEXT for long text.
Dates & booleans
DATE, DATETIME and TIMESTAMP store date/time; BOOLEAN is really TINYINT(1) under the hood in MySQL.
DECIMAL vs FLOAT for money
Use DECIMAL for prices and money — FLOAT/DOUBLE can introduce rounding errors that matter when totals must be exact.