Which books will help you build your database skills? We look at five awesome SQL books.
There’s a common saying that “all wise men read books”. I would say that all professionals read books – particularly those related to their field. There are many books about databases and SQL; most are tied to specific vendors (DB2, Oracle, MS SQL) but there are also plenty that are vendor-neutral.
In this article, I’m going to review a few books that I would recommend to SQL learners at various levels of proficiency. I’ve ranked them from easiest (suitable for absolute beginners) to hardest (for advanced learners).
For some people, the best way to learn is to jump right in. You could do this simply by creating an account with Vertabelo SQL Academy and doing the interactive exercises. For others, it’s better to understand how something works before using it. Either way, these books will improve your SQL skills.
The Manga Guide to Databases
Difficulty: Very Easy
This is definitely the simplest book on databases and SQL that you will ever read. It’s also the most fun, since it’s more of a comic than a traditional book. It presents basic database concepts by way of a magical kingdom called Kod and a princess who learns all about relational databases, normalization, and SQL. And no, I am not making this stuff up.
As you’d expect, the material is simple and the book starts at the absolute beginning by showing the need for databases. Basic database types and relational theory – the theoretical backbone of the modern RDBMS system – are covered. DML (data manipulation language), DDL (data definition language) and TCL (transaction control language) languages are introduced. By the end, the book even tackles some elementary database administration tasks like replication and backups.
If you are a novice, this book is right for you. If you have intermediate knowledge of SQL, you could skip this book. Still, I’d recommend giving it at least a look.
Head First SQL
Link: Head First SQL
If you have not heard of the Head First series, this book is a nice introduction. Head First is a line of O’Reilly books on various computer engineering topics, but they are intended to be more memorable and fun. In every Head First book, the reader is treated as a learner. The series uses the latest research in cognitive science, neurobiology, and educational psychology to make the material stick in your head. Some of the featured learning principles are:
- Make it visual
- Use a conversational writing style
- Make the learner think deeply
- Keep the learner’s attention
- Give it some emotional impact
To achieve this, the book uses a generous dose of pictures, diagrams, and mind maps.
I had lots of fun reading this book and I found the learning principles it employs to be effective. The material covered in this book is a little more complex than in the Manga guide, but I wouldn’t call it advanced. It is fine for complete beginners.
Unlike the Manga guide, this book focuses purely on SQL, so you won’t get an intro to database administration here. You will learn more DCL (data control language) than in the Manga book, and you’ll get a bit more SQL knowledge.
If you’re an intermediate-level SQL learner, you could skip this book. As with the Manga book, though, I’d recommend giving it a try.
Joe Celko’s SQL for Smarties
Here it is – one of the most famous books on SQL. Now in its fifth edition, this is the SQL Bible and it has stood the test of time. It was written by Joe Celko (a famous guy in the SQL world), who served on the ANSI/ISO SQL Standards Committee for 10 years and contributed to the SQL-89 and SQL-92 Standards. If you want to broaden your SQL knowledge, why not learn from the man who literally wrote the language? Don’t be put off by the fact that it’s 900 pages long; this book will give your SQL some serious chops.
As the intro states, Smarties is for the SQL professional who wants to pick up some advanced SQL techniques and programming idioms. It dives deep into every aspect of SQL programming, so anything SQL-related that interests you is likely explained in detail. For example, if you are interested in OLAP, there is a whole chapter dedicated to different grouping flavors (CUBE, ROLLUP, windowing functions, etc). There are also plenty of exercises you can solve along the way. If you like to do puzzles, check out another of Joe Celko’s books, SQL Puzzles.
SQL for Smarties is definitely not for beginners. I’d say it’s an intermediate- to advanced-level book, depending on the chapters you choose to read. If you want something simpler from the same author, look for SQL Programming Style.
Link: SQL Anti-Patterns
Sometimes the best way to learn how to solve a problem is to learn how not to solve a problem. Confused? If you read SQL Anti-Patterns, you will know exactly what I mean. Antipatterns are mistakes that frequently happen when people solve common problems. Patterns are the solution; antipatterns are what not to do.
This book, one of the Pragmatic Programmer line of software engineering books, has a no-nonsense style that many programmers find appealing. It takes a broad look at the following database development areas:
- Logical Database Design
- Physical Database Design
- Query Design
- Application Development
It also shows the main antipatterns (i.e. mistakes) that come up in these areas. For the logical database section, it considers mistakes in designing agnostic database models. The physical database design section covers mistakes with data types, indexing, and other physical aspects of the database. The query design antipatterns, not surprisingly, show common mistakes in writing SQL queries. Finally, the application development anti-patterns focus on application-database interactions and the common mistakes that enable SQL injection, non-safe storage of passwords, and other faults.
Considering specific ways to solve problems in SQL (or how not to solve them) demands quite a bit of proficiency. This book is definitely not for beginners.
SQL Design Patterns
Link: SQL Design Patterns
You may have heard of a famous book called Software Design Patterns, which explained many object oriented modeling and design patterns. This book is meant to fill the gap between that book and SQL programming. To be honest, I don’t think its breadth and significance is equal to Software Design Patterns, but SQL Design Patterns is still very valuable.
This book is part of the Rampant series, which are aimed at the expert database crowd. Rampant editor Donald Burleson has plenty of quality blog posts about SQL and databases; I recommend you check them out.
In SQL Design Patterns, the author lists common SQL patterns and gives a few stimulating examples for you to work out yourself. Some patterns are simple and some are pretty hard. You can get a good idea of the complexity of the material if you just look at the chapters dedicated to trees and graphs (the mathematical constructs, not plants and pictures).
This book is the most advanced on this list and I recommend that you have some months, if not years, of SQL experience under your belt before you take it up. When you do, it will support you on your journey to true mastery.
The List Goes On
If you are a complete SQL novice, I suggest you browse through the advanced books to see what goodies await you. If you are already SQL-proficient, the Manga book will make you laugh and will give you something to talk about on your coffee breaks. If you are on your way to mastery, reading about SQL antipatterns and other complex topics will surely help you improve your skills.
This list is by no means complete. What SQL books had the most impact on you? Tell us about them in the comments section.
And One More Thing…
If you like learning SQL using hands-on exercises, then you’ve got to try Vertabelo Academy.
Vertabelo Academy lets you learn SQL by writing SQL code on your own. You build your SQL skills gradually. Each new concept is reinforced by an interactive exercise. By actually writing SQL code, you build your confidence.
Here’s how it works:
Each exercise in Vertabelo Academy has a short theoretical introduction with examples.
Next, there’s a brief task so you can make sure you understand the theory.
You write your solution to the exercise in the code editor. Vertabelo Academy checks your answer and tells you if it is correct.
If you ever get stuck, each exercise has a hint to guide you in the right direction.
Or you can ask our online community a question.
All you need to start with Vertabelo Academy is a web browser and an Internet connection. Sign up for free!