📖
Theory
Understand the concept step by step
SQL data types define what kind of value a column can store.
Common SQL data types include:
• INT — integer numbers
• DECIMAL — exact decimal numbers
• VARCHAR — variable-length text
• CHAR — fixed-length text
• DATE — dates
• DATETIME — date and time
• BOOLEAN — true or false values
Choosing the correct data type helps maintain valid and efficient data.
💻
Example
See how the concept works in SQL
SQL
CREATE TABLE employees (
id INT,
name VARCHAR(100),
salary DECIMAL(10,2),
joining_date DATE
);📤
Output
Understand what the query produces
The employees table is created with different column data types.
📝
Practice
Test your understanding
Create a products table using INT, VARCHAR, DECIMAL and DATE data types.
❓
MCQs
Check your SQL knowledge
What is the main concept covered in SQL Data Types?
A.VARCHAR
B.INTEGER_ONLY_TEXT
C.STRING_TABLE
D.TEXT_NUMBER
💼
Interview Questions
Prepare for SQL interviews
1
Interview Question
What is a data type in SQL?
2
Interview Question
What is VARCHAR used for?
3
Interview Question
What is the difference between INT and DECIMAL?
4
Interview Question
Which data type can store dates?