What are the different data types in MySQL?

MySQL organizes its column data types into a few main categories: numeric types for storing numbers, string types for text, and date/time types for temporal values, each with variants suited to different precision and storage needs.

Key Points

Example

A products table would use DECIMAL(10,2) for price to avoid rounding errors, VARCHAR(100) for the product name since lengths vary, and DATETIME for created_at to record exactly when the row was inserted.

CREATE TABLE products (
    product_id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100),
    price DECIMAL(10, 2),
    description TEXT,
    created_at DATETIME
);

Interview Tip

A concise interview answer is

MySQL's data types fall into numeric types like INT, FLOAT, and DECIMAL, string types like VARCHAR, CHAR, and TEXT, and date/time types like DATE and DATETIME. The main judgment call is picking DECIMAL over FLOAT for anything like money, since DECIMAL avoids floating-point rounding errors that FLOAT and DOUBLE are prone to.

Last updated: 11 November 2026

Previous question: What is normalization in SQL?

Next question: What is the difference between a primary key and a unique key?

More SQL interview questions

All SQL questions