Our editors independently research, test, and recommend the best products; you can learn more about our review process here. We may receive commissions on purchases made from our chosen links.
Best for Beginners: Getting Started with SQL at Amazon
"At 130 pages, the book is relatively short, intent on helping readers master the fundamentals and quickly learn how to perform useful tasks."
Runner-Up, Best for Beginners: SQL All-in-One For Dummies at Amazon
"SQL All-in-One for Dummies is a tome, but its 750+ pages are split into eight volumes, with a logical structure that makes working through it less overwhelming."
Best for Quickly Getting Up to Speed: SQL in 10 Minutes at Amazon
"The book does a great job of teaching the essentials in a hurry and is broken down into 22 lessons."
Best for Creating Complex Queries: SQL Queries for Mere Mortals at Amazon
"The author offers hundreds of examples to accompany his clearly-written explanations of SQL concepts, techniques, and best practices for database design and queries."
Best for Quick Reference: SQL Pocket Guide at Amazon
"Designed as a reference rather than a how-to manual, there's no need to read the book from cover to cover."
Best for Learning T-SQL: T-SQL Fundamentals at Amazon
"All code samples have been tested against both the cloud and on-premises installations of SQL Server, so you'll be able to use them regardless of the version you have access to."
Best for Developers: Murach's SQL Server 2016 for Developers at Amazon
"Its twenty chapters are split into four sections — introduction, essential SQL skills, advanced SQL skills, and database design and implementation."
Best for Learning by Doing: SQL Practice Problems at Amazon
"For those who don't have access to an existing database server, setup instructions are included for the free Microsoft SQL Server Express Edition and management studio, along with a video walkthrough for the sample database."
Courtesy of Amazon
Veteran technology publisher O'Reilly has put out many different SQL guides over the years, but for those just dipping their toes in the water, Getting Started with SQL is the ideal place to begin.
At 130 pages, the book is relatively short, intent on helping readers master the fundamentals and quickly learn how to perform useful tasks. Crammed with hands-on examples and helpful explanations, it's written in a straightforward, accessible style that doesn't assume much or any prior knowledge. Helpfully for those just starting out, the book doesn't require access to an existing database server. Instead, it explains how to set up a practice environment at home, using SQLite to reduce cost and complexity.
While the bulk of the book focuses on the basic commands required for data retrieval, sorting, and updating, the final chapter discusses more advanced topics and provides additional resources for those who are interested.
Chances are you've seen the distinctive black and yellow design of a "For Dummies" book at some point — the series does cover an incredible range of topics, after all. SQL All-in-One for Dummies is a weighty tome, but its 750+ pages are split into eight volumes, with a logical structure that makes working through it less overwhelming. The book is written in a light and accessible manner — it does assume a degree of general technical knowledge from the reader, but not necessarily of database administration or development.
As well as the basic concepts behind the language, SQL All-in-One for Dummies covers several other related topics, including data security, development, XML, database performance tuning, and more. The book is available in both Kindle and physical form, with code downloads available from the publisher.
If you're a developer, business analyst, or anyone else needing to quickly come to terms with using SQL, SQL in 10 Minutes was written with you in mind. While you're unlikely to become an expert quite that quickly, the book does a great job of teaching the essentials in a hurry and is broken down into 22 lessons that cover everything from basic SELECT and UPDATE statements to more advanced topics like stored procedures and transactional processing.
The content is presented in a logical and methodical order, but it's also easy to dip in and out of each section as needed, learning syntax and concepts only when you require them. Several database platforms are covered in the text, from Microsoft Access and SQLite to MySQL, Oracle, and more, making examples relevant and directly applicable to a wider range of readers. With full-color code examples in the paper version of the book, and plenty of tutorials and explainers along the way, this is the ideal resource for the time-starved SQL learner.
As the name suggests, SQL Queries for Mere Mortals focuses on teaching its readers how to become expert at creating even complicated queries with ease. With a logical and humorous approach to what isn't the most exciting of subjects, the author offers hundreds of examples to accompany his clearly-written explanations of SQL concepts, techniques, and best practices for database design and queries.
Beginners will get large amounts of value from this book, but even those with a fair degree of existing knowledge are likely to learn several new tips and tricks (and probably unlearn a few bad habits along the way.) Updated for the fourth edition with new advanced topics like partitioning and grouping, sample databases and creation scripts are available for Microsoft Access, SQL Server, MySQL, and other platforms. Available in Kindle and paperback format, this is the book to buy if you're looking to dramatically lift your SQL query game.
Whether you're an entry-level developer or database administrator, or you've been working with SQL for years, remembering the details of every possible command and argument would be a superhuman feat. That's where Jonathan Gennick's compact SQL Pocket Guide comes in.
Covering a range of database servers including Microsoft SQL Server, Oracle, DB2, and others, this handy reference explains implementation differences between platforms and serves as an excellent refresher for rarely-used commands.
Designed as a reference rather than a how-to manual, there's no need to read the book from cover to cover — it's designed to sit on a desk and be consulted when necessary. While you could find most of the information inside with a few good Google searches, being able to quickly flick through SQL Pocket Guide for the exact details you need is often faster, more specific, and holds far less chance of distraction.
Most SQL guides and references try to be platform-agnostic, which allows them to be useful to a wider range of readers at the cost of not always being entirely accurate or complete for any particular database system. For those required to work entirely with Microsoft SQL Server, however, focusing entirely on the intricacies of Transact-SQL — Microsoft's specific variant of the language — may well be a better option.
While it's aimed at those new to the language, T-SQL Fundamentals isn't afraid to tackle more advanced, optional topics as well, and long-time practitioners aren't likely to walk away empty-handed. All code samples have been tested against both the cloud and on-premises installations of SQL Server, so you'll be able to use them regardless of the version you have access to.
Useful for developers, database administrators, and power users alike, this book isn't just a list of commands and syntax. Instead, it teaches both the theory behind T-SQL and how best to make use of it in the real world, with plenty of practical examples to help out along the way.
Whether you're an experienced developer needing to enhance your Microsoft SQL Server skills or an entry-level programmer looking to get better at SQL coding, Murach's SQL Server 2016 for Developers is the perfect place to start.
As the title suggests, the nearly 700-page book is primarily aimed at developers, but where relevant, useful information on database administration is also presented. Its twenty chapters are split into four sections — introduction, essential SQL skills, advanced SQL skills, and database design and implementation — using Murach's unusual but sensible approach of placing concepts and discussion on the left/even-numbered pages, and related screenshots and examples on the right/odd-numbered pages.
Everything is explained simply and clearly, whether it's introductory topics like retrieving and summarizing data, or more complicated subjects like stored procedures, triggers, or using the .NET common language runtime (CLR).
For those who don't have an existing MS SQL server instance to use, instructions are included at the end of the book for setting up and using the sample database.
For those looking to expand their SQL knowledge beyond what's typically available in study guides and online tutorials, SQL Practice Problems takes a refreshingly different approach to learning the language.
The book contains 57 problems, ranging in difficulty from beginner to advanced, and designed to mimic the kinds of challenges that SQL users face in the real world. The author's intention is to teach readers to "think in SQL," analyze data problems, and come up with high-quality solutions.
For those who don't have access to an existing database server, setup instructions are included for the free Microsoft SQL Server Express Edition and management studio, along with a video walkthrough for the sample database.
SQL Practice Problems is largely oriented toward those looking to retrieve data (via SELECT statements) rather than updating existing information, and who need to learn the most-effective ways of doing so. It's available in both Kindle and paperback versions, and the author is available by email for assistance with problems and queries.