People often ask me which book they should buy to learn SQL. It’s a fair question. There are hundreds of SQL books out there, and a lot of them are either outdated, padded with filler, or written for people who already know the subject.
So I’ve put together a short list of the ones I think are worth your money. Some are for complete beginners, some are for when you’re ready to design proper databases, and a few are for the day you start caring about performance and scale. I’ve grouped them by level so you can pick the right one for where you are now.
Disclosure: some links on this page are affiliate links. If you buy through them, SimplifyDatabase may earn a small commission at no extra cost to you. It helps keep the site free.

Quick Comparison
| Book | Level | Best for |
|---|---|---|
| SQL in 10 Minutes a Day | Beginner | Learning the basics fast |
| Learning SQL | Beginner | A solid all-round foundation |
| SQL Queries for Mere Mortals | Beginner to intermediate | Really understanding how queries work |
| Practical SQL | Beginner to intermediate | Hands-on data analysis with PostgreSQL |
| Database Design for Mere Mortals | Intermediate | Designing tables the right way |
| T-SQL Fundamentals | Intermediate | SQL Server developers |
| SQL Antipatterns, Volume 1 | Intermediate | Avoiding common design and query mistakes |
| SQL Performance Explained | Intermediate to advanced | Indexes and fast queries |
| Designing Data-Intensive Applications | Advanced | How modern data systems work |
| Database System Concepts | Advanced / academic | Deep theory, university-level study |
Best SQL Books for Beginners
1. Sams Teach Yourself SQL in 10 Minutes a Day
Author: Ben Forta
Level: Complete beginner
Best for: Getting productive quickly
The title is a bit of a stretch, but the idea behind it is good. The book is split into short lessons that each take about ten minutes, so you can learn a little every day without feeling buried. It covers SELECT, filtering, sorting, joins, grouping and changing data, and it points out where MySQL, SQL Server, PostgreSQL and Oracle differ.
Why I recommend it: It’s the least intimidating SQL book I know. If you’ve tried to learn before and given up, start here.
Skip it if: you want depth. It’s a quick-start guide, not a complete reference.
2. Learning SQL (3rd Edition)
Author: Alan Beaulieu (O’Reilly)
Level: Beginner
Best for: A complete, well-paced foundation
If I could only recommend one beginner book, it would probably be this one. It starts from zero and builds up step by step: queries, filtering, joins, sets, grouping, subqueries, and later on window functions, views and transactions. The third edition also covers working with large data sets and SQL in analytics.
Why I recommend it: It’s clear, accurate and doesn’t waste your time. You can read it front to back, and it still works as a reference later.
Skip it if: you prefer lots of pictures and humour. The style is fairly plain.
3. SQL Queries for Mere Mortals (4th Edition)
Author: John L. Viescas
Level: Beginner to intermediate
Best for: Understanding why a query works, not just copying it
This is a big book, and that’s the point. Viescas takes time explaining how to think about a problem before you write the query, and he uses several sample databases so you see the same ideas applied to different situations. The chapters on joins, subqueries and grouping are some of the clearest explanations I’ve read.
Why I recommend it: When JOINs or subqueries still feel confusing, this is the book that makes them click.
Skip it if: you want something short. It’s long, and it’s best read a chapter at a time.
4. Practical SQL (2nd Edition)
Author: Anthony DeBarros (No Starch Press)
Level: Beginner to intermediate
Best for: Learning SQL through real data analysis
DeBarros is a data journalist, and it shows. Instead of made-up tables, you work with real public data sets like census data and analyse them with PostgreSQL. Along the way you pick up importing data, cleaning messy values, statistics in SQL and working with dates and text.
Why I recommend it: It’s the most hands-on book on this list. You finish each chapter having actually done something with real data.
Skip it if: you only use SQL Server or MySQL. Most of the SQL carries over, but the examples are PostgreSQL.
Best Books for Database Design
5. Database Design for Mere Mortals (25th Anniversary Edition)
Author: Michael J. Hernandez
Level: Intermediate
Best for: Designing a database from scratch
Writing queries is one skill. Designing the tables those queries run on is another, and it’s the one that saves you years of pain later. This book walks you through the whole process: interviewing users, defining tables and fields, choosing keys, setting up relationships and checking your design for problems. It hardly uses SQL code at all, which makes it useful whatever database you work with.
Why I recommend it: It’s the best plain-English guide to design I know. It goes perfectly with our articles on primary and foreign keys and normalization.
Skip it if: you’re looking for SQL syntax. This is about design, not code.
6. T-SQL Fundamentals (4th Edition)
Author: Itzik Ben-Gan (Microsoft Press)
Level: Intermediate
Best for: Anyone working with Microsoft SQL Server
Itzik Ben-Gan is one of the best-known SQL Server teachers, and this book is his foundation course. It explains T-SQL (SQL Server’s version of SQL) properly, including the logic behind how queries are processed, set-based thinking, joins, subqueries, window functions, data modification and transactions. Each chapter comes with exercises and solutions.
Why I recommend it: I work with SQL Server every day, and this is the book I’d hand to anyone joining a SQL Server team. If you’re new to the platform, read Microsoft SQL Server Explained for Beginners first.
Skip it if: you don’t use SQL Server. Pick Learning SQL or Practical SQL instead.
7. SQL Antipatterns, Volume 1
Author: Bill Karwin (Pragmatic Bookshelf)
Level: Intermediate
Best for: Learning from common mistakes
Each chapter takes one mistake developers make again and again, like storing comma-separated lists in a column, using generic “attribute/value” tables, or getting NULL wrong. Karwin explains why people do it, what goes wrong, and what to do instead.
Why I recommend it: Reading it feels like getting advice from a senior developer who has seen every bad database. You’ll probably recognise a few mistakes from your own projects. I certainly did.
Skip it if: you’re brand new to SQL. It makes more sense once you’ve built a database or two.
Best Books for Performance and Advanced Topics
8. SQL Performance Explained
Author: Markus Winand
Level: Intermediate to advanced
Best for: Making slow queries fast
This short book is all about indexes: how they work, how the database decides whether to use them, and how to write queries that take advantage of them. It covers MySQL, PostgreSQL, SQL Server and Oracle, and it’s written for developers rather than database administrators.
Why I recommend it: If our SQL indexes article got you curious, this is the natural next step. It’s short enough to finish in a weekend.
Skip it if: you’re still learning basic queries. Come back to it when performance starts to matter.
9. Designing Data-Intensive Applications (2nd Edition)
Author: Martin Kleppmann and Chris Riccomini (O’Reilly)
Level: Advanced
Best for: Understanding how modern data systems work
This isn’t a SQL book. It’s about the big ideas behind databases and data systems: storage engines, replication, partitioning, transactions, consistency, and batch and stream processing. The first edition became a classic among backend developers and data engineers, and the second edition updates it for today’s tools.
Why I recommend it: When you start asking “how does the database actually do this?” or need to choose between systems (see SQL vs. NoSQL), this is the book.
Skip it if: you’re a beginner. It assumes you’re comfortable with programming and databases already.
10. Database System Concepts
Author: Abraham Silberschatz, Henry F. Korth and S. Sudarshan
Level: Advanced / academic
Best for: Students and anyone who wants the full theory
This is the textbook many universities use for their database courses. It covers the relational model, SQL, design, storage, indexing, query processing, transactions and more, in serious depth. It’s not light reading, but it’s thorough and reliable.
Why I recommend it: If you’re studying computer science or want to understand databases at the deepest level, it’s the standard reference.
Skip it if: you just want to write queries at work. It’s far more than most people need.
Which Book Should You Start With?
If you’re not sure, here’s my simple advice:
- Never written a query? Start with SQL in 10 Minutes a Day or Learning SQL.
- Want to analyse data? Go for Practical SQL.
- Working with SQL Server? Get T-SQL Fundamentals.
- About to design a new database? Read Database Design for Mere Mortals first.
- Queries getting slow? SQL Performance Explained.
- Thinking about architecture and scale? Designing Data-Intensive Applications.
One more tip: don’t buy five books at once. Pick one, work through the examples on a real database, and only move on when you’ve finished it. You’ll learn far more from one book you actually complete than from a shelf of books you’ve only started.
Learn Alongside the Books
Books work best when you practise. If you’re just starting, our free guides are a good companion: begin with Start Here: Learn Databases the Easy Way, then try SQL for Complete Beginners and WHERE, ORDER BY and LIMIT.
Have a favourite SQL book that isn’t on this list? Get in touch and let me know. I’m always looking for good recommendations.