Lessons
Short, hands-on Postgres exercises. Sign in to run them in your own sandbox and track your progress.
Sign in with GitHub
Query fundamentals
beginner
Module 1
01
SELECT basics
8 min
·
select · where · order-by
02
WHERE in depth
12 min
·
select · where · predicates
03
Sorting and pagination
12 min
·
order-by · distinct · limit · offset · pagination
04
Aggregations and GROUP BY
12 min
·
aggregate · group-by · having
Changing data
beginner
Module 2
01
Inserting and updating rows
10 min
·
insert · update · returning · dml
02
Deleting rows and row lifecycle
12 min
·
delete · truncate · soft-delete · dml
03
Upsert with ON CONFLICT
12 min
·
insert · on-conflict · upsert · excluded · dml
04
Transactions basics
14 min
·
transactions · begin · commit · rollback · savepoint
Combining tables
beginner
Module 3
01
Joining tables
14 min
·
join · inner-join · left-join
02
Advanced joins
14 min
·
join · right-join · full-join · cross-join · self-join
03
Set operations
12 min
·
union · union-all · intersect · except · set-operations
04
Subqueries
14 min
·
subquery · exists · correlated · lateral · in
Schema and modeling
intermediate
Module 4
01
Data types
14 min
·
data-types · numeric · boolean · enum · identity
02
Dates and times
15 min
·
timestamptz · interval · time-zone · date-trunc · extract
03
Constraints
14 min
·
constraints · primary-key · foreign-key · check · unique
04
DDL and schemas
14 min
·
ddl · create-table · alter-table · drop-table · schemas · search-path
05
Normalization
15 min
·
normalization · normal-forms · keys · relationships · junction-table
Intermediate querying
intermediate
Module 5
01
Conditional expressions
12 min
·
case · coalesce · nullif · conditional · null
02
Common table expressions
12 min
·
cte · with · readability
03
Window functions
13 min
·
window-functions · over · partition-by · row-number · rank
04
Advanced window functions
14 min
·
window-functions · lag · lead · running-total · frames
05
Recursive CTEs
15 min
·
recursive-cte · with-recursive · hierarchies · graph-traversal
Postgres power types
advanced
Module 6
01
JSON and JSONB
15 min
·
json · jsonb · operators · containment · gin-index
02
Arrays
13 min
·
arrays · unnest · any · all · array-operators
03
Full-text search
14 min
·
full-text-search · tsvector · tsquery · ranking · gin-index