Cover of SQL from Zero
Zero to Production

SQL from Zero

A Beginner's Guide to PostgreSQL, Relational Databases, and Writing Real Queries

Learn SQL from the beginning with PostgreSQL as the practical setting. Explore relational databases and develop the understanding needed to write real queries and work more confidently with structured data.

View on Amazon ↗

Opens Amazon in a new tab. Check the listing for formats and availability.

A closer look

About this book.

You don't need a computer science degree to learn SQL — you need a clear path and real practice. SQL from Zero takes complete beginners from "what is a database?" to writing the same joins, aggregations, and multi-table queries that working analysts and developers use every day, using PostgreSQL, one of the most popular open-source databases in the world.

Every chapter builds on a single running example — a small independent bookstore called Riverside Books — so instead of disconnected toy examples, you watch one realistic database grow more useful as you learn more tools to query it. You'll go from your very first SELECT statement to designing multi-table schemas with proper constraints, combining tables with joins and subqueries, summarizing data with GROUP BY and window functions, and working with PostgreSQL-specific features like JSONB columns, views, and transactions.

Inside, you'll find

  • A complete, beginner-friendly walkthrough of installing and connecting to PostgreSQL
  • Clear, plain-language explanations before every block of syntax
  • Realistic, annotated SQL examples you can run yourself
  • Exercises after every chapter, with a full worked answer key in the back
  • A hands-on capstone project tying every concept together into real business questions
  • A quick-reference appendix and the complete sample database script, ready to load

Whether you're preparing for a data-adjacent role, want to finally query your own numbers instead of asking someone else to, or are simply curious how the software behind nearly every app actually stores and retrieves data, this book gives you a durable, practical foundation in SQL — one you'll still be using a decade from now.

Beyond the book

Reader resources.

Download chapter code (ZIP)

Includes a README with setup notes and a chapter-by-chapter file index.

Official documentation and guides for topics covered in this book.

← Back to the books