What are SQL data types in MySQL?
Why Interviewers Ask This
This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex MySQL / SQL topics. It also reveals how well you can explain technical ideas to non-experts.
Answer
MySQL data types determine what kind of data can be stored in a column. Main categories: Numeric: INT (4 bytes, -2B to 2B), TINYINT (1 byte, 0-255 unsigned), BIGINT (8 bytes), DECIMAL(p,s)/NUMERIC (exact decimal, ideal for money — e.g., DECIMAL(10,2) for currency), FLOAT/DOUBLE (approximate floating point — avoid for monetary values). String: VARCHAR(n) (variable-length string up to n chars, most common), CHAR(n) (fixed-length — pads with spaces, faster for fixed-width data like country codes), TEXT/MEDIUMTEXT/LONGTEXT (large text — up to 4GB), ENUM("val1", "val2") (restricted set of values). Date/Time: DATE (YYYY-MM-DD), DATETIME (YYYY-MM-DD HH:MM:SS), TIMESTAMP (like DATETIME but stored as UTC, auto-updates supported), TIME, YEAR. Binary: BLOB, BINARY, VARBINARY. Boolean: MySQL uses TINYINT(1) — 0 = false, 1 = true. JSON: native JSON type in MySQL 5.7+ for semi-structured data.
Pro Tip
If you're unsure about a detail, say so honestly and explain your reasoning. Interviewers respect candidates who can think through uncertainty rather than bluffing.