A Stepshala publication
SQL & Postgres,
Step by Step.
Learn SQL and PostgreSQL against one small store database, with every output captured from a real run. All five stages are complete — 18 parts from first queries through performance tuning, plus four career tracks.
Part 1 · Getting started
Stage 1 · FoundationFig. 02
How to use this guide
Study one part at a time: read the lesson with psql open beside it, run the examples, solve the exercises, then move on.
New here? See how every part is organised and how to study — Stage 1 overview
Five stages
Foundation through specialization, in order.
Stage 1: Foundation
Install PostgreSQL, drive psql, and answer business questions from one table.
Stage 2: Intermediate — querying across tables
Join tables, structure hard questions with subqueries and CTEs, and write window-function analytics.
Stage 3: Advanced — modeling, writing and Postgres features
Design schemas with constraints, write data safely, reason about transactions, and use JSONB and search.
Stage 4: Performance & internals
How Postgres works inside — then plans, indexes, and a method for slow queries.
Stage 5: Specialization — pick one track
Pick one career track and ship a portfolio capstone.
Practice and reference
Build the stage project, then keep the one-page guide and the practice database close by.