Lesson 15 of 22 · PostgreSQL

Data Types

Learn PostgreSQL data types (SERIAL, TEXT, TIMESTAMP, JSONB and more), then build a table with them.

TypeDescription
INTEGERWhole numbers
SERIALAuto-incrementing
TEXTVariable-length string
BOOLEANtrue/false
TIMESTAMPDate + time
JSONBBinary JSON
UUIDUnique ID
DECIMAL(p,s)Exact numeric

Your challenge

Create a table events with id (SERIAL primary key), title (TEXT, NOT NULL), starts_at (TIMESTAMP) and details (JSONB). Add one event titled Launch, starting 2025-01-01 09:00, with details {"room": "A"}.

Solve it in your browser

Free, no sign-up. The PostgreSQL database runs in your browser; your answer is checked instantly, with hints if you need them.