Sql Data Types — Free Sql Tutorial
Learn Sql Data Types in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn Sql Data Types in Sql with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
Sql Data Types in Sql
SQL data types define what kind of data a column can store: numbers, text, dates, booleans. Choosing the right type ensures data integrity and optimises storage.
Numeric types: TINYINT (1 byte, 0-255), INT (4 bytes, -2B to +2B), BIGINT (8 bytes), DECIMAL(p,s) (exact decimal for money), FLOAT/DOUBLE (approximate floating-point).
Text types: CHAR(n) (fixed-length string, pads with spaces), VARCHAR(n) (variable-length, up to n chars), TEXT (unlimited). Use VARCHAR for flexibility.
Date/Time: DATE (YYYY-MM-DD), DATETIME (YYYY-MM-DD HH:MM:SS), TIME, TIMESTAMP. Use DATE for pure dates, DATETIME for date+time.
Sql Data Types — Syntax
INT, BIGINT, TINYINT DECIMAL(10,2) -- 10 total digits, 2 after decimal VARCHAR(100) -- up to 100 chars DATE, DATETIME, TIMESTAMP BOOLEAN (or TINYINT(1) in MySQL)
Learn Sql Data Types step by step with Syllab's free interactive Sql tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full Sql course →