Data Types
A data type is the kind of value a column can hold. INT is a whole number (roll, marks). VARCHAR(50) is short text (name). DATE is a calendar day. DECIMAL(10,2) is money — not FLOAT, because 0.1 + 0.2 in binary floats is messy.
Pick the smallest type that fits. Marks 0–100 → TINYINT or INT, not VARCHAR. Phone as VARCHAR, not INT — leading zero and +91 will break. ENUM is a short fixed list (‘pass’,‘fail’) — don’t use it for a list that grows every week.
NULL means ‘unknown’, not zero and not empty string. A marks column can be NULL if the exam is not written yet. Don’t write WHERE marks = NULL. Write WHERE marks IS NULL.
Board: CREATE TABLE students (roll INT PRIMARY KEY, name VARCHAR(50) NOT NULL, marks INT, dob DATE). That one line teaches types better than a chart of 40 names.
Trap: storing money in FLOAT. Trap: VARCHAR(1) for names. Trap: using TEXT for every column ‘just in case’ — indexes and memory suffer.
On the example next to this theory: Data Types: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.
INT / VARCHAR / DATE / DECIMAL. Show one CREATE TABLE. NULL ≠ 0.