0Pricing
SQL Academy · Lesson

Data Types Overview: INT VARCHAR DATE BOOLEAN

Learn the core SQL data types: integers, varchar/text, dates and timestamps, booleans, and decimals, and how to pick the right type for each column.

Why Types Matter

Every column has a fixed type. The type defines:

  • What values are valid
  • How much storage each row uses
  • Which operators and functions apply
  • How the planner picks indexes and joins

Integer Types

PostgreSQL has three integer sizes:

SMALLINT  -- 2 bytes,  -32768 to 32767
INTEGER   -- 4 bytes,  ±2.1 billion       (alias: INT)
BIGINT    -- 8 bytes,  ±9.2 quintillion

-- Auto-incrementing variants:
SMALLSERIAL  BIGSERIAL  SERIAL

All lessons in this course

  1. What an RDBMS Is and Why Tables Matter
  2. Primary Keys and Uniqueness
  3. NULL: The Third Truth Value
  4. Data Types Overview: INT VARCHAR DATE BOOLEAN
← Back to SQL Academy