Skip to main content

Command Palette

Search for a command to run...

SQL Tables & Data Types

Published
•1 min read•View as Markdown

1. What is a Table in SQL?

A table is like a spreadsheet where data is stored in rows and columns.

  • Columns: Define the type of data (like Name, Age, Email).

  • Rows: Contain the actual data entries.

Example Table: Students

Column NameData TypeExample
IDINT1
NameVARCHAR'Priyaa'
AgeINT20
EmailVARCHAR'priyaa@email.com'

2. What are Data Types?

Data types tell SQL what kind of data can be stored in a column.

Example

Data TypeDescriptionExample
INTWhole numbers1, 25, 100
VARCHARText (string)'Priyaa'
DATEDates'2026-01-26'
FLOATDecimal numbers10.5, 99.99
BOOLEANTrue or FalseTRUE, FALSE