Loading Depth Study
Preparing your workspace
A column's data type defines what kind of value it can store and how MySQL should handle that value.
Common MySQL types include INT for whole numbers, DECIMAL for exact numeric values such as prices, VARCHAR for variable-length text, TEXT for larger text, DATE and DATETIME for dates and timestamps, and BOOLEAN-like values commonly represented using numeric types. Choosing the correct data type improves consistency, storage, and query behavior. Table design should also consider whether a value is required, unique, or allowed to be empty.
A course table may store its title as VARCHAR, lesson count as INT, price as DECIMAL, and publication timestamp as DATETIME.
CREATE TABLE courses ( id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(150) NOT NULL, price DECIMAL(10,2) NOT NULL, lessons_count INT NOT NULL, published_at DATETIME );
A courses table is created with appropriate types for identifiers, text, money, counts, and dates.