Jump to ratings and reviews
Rate this book

Practical SQL: A Beginner's Guide to Storytelling with Data

Rate this book
Second edition of the best-selling Practical SQL. An approachable guide to programming in SQL (Structured Query Language) that will teach even beginning programmers how to build powerful databases and analyze data to find meaningful information.

Practical SQL is an approachable and fast-paced guide to SQL (Structured Query Language) written by longtime professional journalist Anthony DeBarros. SQL is the primary tool that programmers, web developers, researchers, journalists, and others use to explore data in a database. DeBarros focuses on using SQL to find the story in data, with the aid of the popular open-source database PostgreSQL and the pgAdmin interface.

This thoroughly revised second edition includes a new chapter describing how to set up PostgreSQL and more extensive discussion of pgAdmin's best features. The author has also added a chapter on the JSON data format that shows readers how to store and query JSON data. DeBarros has also updated the data in the book throughout, added coverage of additional topics, and perfected the book's examples.

Readers love DeBarros's use of exercises and real-world examples that demonstrate how to:

- Create databases and related tables using your own data
- Correctly define data typesAggregate, sort, and filter data to find patterns
- Clean their data and transfer data as text files
- Create advanced queries and automate tasks

This book uses PostgreSQL, but the SQL syntax is applicable to many database applications, including Microsoft SQL Server and MySQL.

427 pages, Paperback

Published January 25, 2022

235 people are currently reading
871 people want to read

About the author

Anthony DeBarros

1 book11 followers
Anthony DeBarros is an award-winning journalist who's combined avid interests in data analysis, coding, software product development, and storytelling for much of his career. He's currently a data editor for the Wall Street Journal, focusing on topics including the economy, trade, the U.S. Census, and politics. He previously held positions with USA TODAY, the Poughkeepsie Journal, and the DocumentCloud project for Investigative Reporters and Editors.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
104 (45%)
4 stars
90 (39%)
3 stars
29 (12%)
2 stars
6 (2%)
1 star
1 (<1%)
Displaying 1 - 30 of 31 reviews
Profile Image for Jake.
211 reviews45 followers
June 15, 2018
So I've been taking a sql for data science course on coursera and I used this book heavily to fill in some of the cracks in the course. The book is portentous at times but mostly enjoyable, presented more as a cookbook than a textbook. Take for instance chapter six, the two page section entitled: "Using NULL to Find Rows with Missing Values". I found that to be an incredibly useful piece of information that would be left out of most textbooks on the subject but incredibly valuable. I was quite stuck on it. I kept trying to say something like Names == NULL instead of Names IS NULL.

I recommend coming to this book when you need it, using it as a reference. Following the labs and learning from the ground up doesn't sound worthwhile to me.
Profile Image for Holden Johnson.
Author 2 books49 followers
April 11, 2019
Very great starting point into SQL and a solid refresher.

I would recommend this book to anyone looking to begin using SQL to work with relational databases, or someone who would like a refresher on some of the more uncommon or less used functions.

Very good explanations, fun to read and not dry or boring.
Profile Image for Mahmoud Shrif.
45 reviews80 followers
July 2, 2024
كتاب جااااااااامد

The book is great for beginners, it's a practical book so you're going to execute SQL commands a lot by yourself.
the DBMS used is PostgreSQL.

it's time to practice what I've learned at https://www.sql-practice.com/
Profile Image for Earl Grey Tea.
708 reviews34 followers
October 1, 2018
In order to develop into a new position at work, I needed to learn SQL to be qualified for the job. Lynda.com and W3Schools provide lessons on SQL. However, these online resources can have holes in their bodies of knowledge in addition to not flowing in the most logical manner.

Practical SQL is a beginner's guide to SQL but not to coding. The biggest challenge that I found in this book was trying to install PostgreSQL, the program that allows one to run a database on their computer. After two days of trying, I failed. Instead of abandoning the book since I couldn't follow along with the exercises, I just read everything to get the big picture concept of SQL.

The big positive about this book is that it ties different ideas together and does a nice job of explaining the what and the how behind the code. The Lynda.com tutorial that I found on the Join command was only two minutes long, rushed through the concept, and assumed that you had more knowledge about SQL coding than a beginner (i.e. me) would. After reading the chapter on Joins in this book, I have a better understanding of the coding.

There are a plethora of real world examples to learn the basics of SQL in this book. However, about halfway through, the difficulty of the material really starts to ramp up and leads to discussions about integrating your SQL data with other programs and computer languages.

I wasn't able to take away the most that I could from this book since I was unable to install PostgreSQL. However, when I started to run queries at work using SQL Developer on our database, it was much easier trying to pull targeted data since I had learned nice overview of SQL from this book.

Due to complications, this book wasn't exactly what I was looking for. A book on SQL that would allow me to jump in easily and start practicing right away. I have seen other books on different computer programming languages by the publisher No Starch Press. After this book, I would definitely be incline to start learning new languages from a book by this company.
Profile Image for Lamadia.
676 reviews22 followers
February 6, 2021
Surprisingly readable. It wasn't boring at all, possibly because the real world data sets he used were really interesting. He also kept introducing new data sets and real questions to solve with them. It was also more comprehensive than any of the beginners courses online.
Profile Image for Ben.
2,729 reviews225 followers
March 23, 2022
I enjoyed this one.

I have been using SQL for years and am quite proficient at it.

This book helped with some of the storytelling side of it, and had some great tricks to help with data analysis and reporting.

I am fairly interested in data science, so this was a good read.

Would recommend.

4.8/5
Profile Image for Martin Denton.
Author 19 books27 followers
October 17, 2022
This is an excellent guide to learning the PostgreSQL database and SQL programming. It was the pivotal resource in my first attempt to build a database with this software (successfully, I'm happy to add).

What I like best about DeBarros's approach is that he isn't a techie but rather a journalist who has an interest in using tools that will help him accomplish his work. So the writing is clear and jargon-free and without any expectations that the reader knows a lot about databases or software or systems development. And the examples are practical and interesting and varied. As a census nerd, I appreciated the info about how to get data from the Census Bureau and other sources to research population and demographics.

I highly recommend this book for anyone who is interested in learning how to create his/her own personal datasets for use in whatever work they're involved with. PostgreSQL is a free and open-source platform, so the only cost, apart from time, will be the price of this book. And that's well worth it.
139 reviews1 follower
September 27, 2021
Excellent book no SQL. Very practical with lots of good examples.

Covers some important topics, like time, and GIS, functions and how to write more advanced queries. Highly recommend, especially if you don't know much about SQL to begin with. It's a great place to start. Uses Postgres, but most of it translates to other DBs.
Profile Image for Peter Augustinak.
121 reviews
August 24, 2022
In my job I have been using SQL for many years, but recently I have decided to step up a bit higher in the database knowledge and this book showed up first. Even better that it is Postgres oriented as this is the DB vendor I have been using recently the most.

Lot of very useful information and exercises, basically from scratch up to really advanced topics - I had no idea, for example, that something like Postgis exists and we can query and display navigation data in a map :)
I've always considered such a technical books more like something what should give you a better overview than a tool how you can learn and "remember" everything and since you finish the book you are a pro and all the knowledge is in your pocket. Important is you have the idea what is possible and that you have a great reference for some future cases you probably bump into.

I would like to put extra points to the author for the general idea of "data storytelling". Great work, recommended.

Profile Image for Gregory Muller.
18 reviews1 follower
May 4, 2021
I have read and judged a lot of books. This book is not like anything I typically read. For the past few weeks, as I have been reading Practical SQL, I have been trying to come up with a metaphor or a way to describe it. What ended up happening was when I talked with friends, and family I described it is as a textbook.

Because that is what I believe it to be.

The book has lots of technical aspects to it because it is trying to formally teach someone how to use the programming language known as SQL. Like a textbook, it has problems at the end of each chapter that the student can try their skills out on. This is where true learning takes place as the training wheels are off, and I have to reason out how to solve the problems.

I solved every problem in the book, from front to back. I read all 332 pages of the book. I struggled with this book a bit because how to balance reading time with practical coding time is something I am not sure I actually figured out. I got out to a large lead in my reading before I coded, so I was always playing catch up in a sense.

The book teaches, and it teaches well. I have more skills than someone who has never taken a programming class, and more skills than people who only briefly touch the basics of SQL. I have no idea where these tools will be used, but as a hammer in the shed, I know thanks to this book, I have got the tools nearby.
Profile Image for Carlos.
65 reviews
October 24, 2023
Not bad, but there are better books out there with more proof of concept methods of teaching SQL. Lots of times I felt like the material was rushed or didn't provide enough common real-word examples so you sort of felt like what you learned wouldn't really apply to business use-cases. With this book, DeBarros makes the often intimidating world of SQL (Structured Query Language) accessible and engaging for beginners.

This practical guide is your tool for understanding and using SQL to harness the power of data for effective storytelling. It offers a hands-on approach, using real-world examples and exercises to demystify the world of databases and data manipulation.

DeBarros takes you on a journey where you learn to extract meaningful insights from data and craft compelling narratives. As you progress through the book, you'll discover how to ask questions of your data, retrieve the information you need, and present your findings effectively.
Profile Image for Skywalker Hu.
135 reviews3 followers
October 15, 2020
Very comprehensive. I dare say exhaustive in terms of introducing SQL to an intermediate level, if not advanced, from the perspective of someone who self-studies SQL. I tried Microsoft SQl Server, which presents hell of a problem connecting to the database; DB SQlite, which is very easy to start with, but seems to have limited functionalities given its light-weight nature. PostgreSQL is a very good DBMS in my perspective.
Did not know you can build your own functions in SQL, although it is quite painful compared to languages like Python, Swift, or others.

Nevertheless, a very solid read on data analysis using SQL and PostgreSQL.
22 reviews
August 16, 2021
A great introductory book for a total beginner looking to get their feet wet with SQL.

I picked this up only a few months before starting my first role as a data analyst. It proved to be a great guide and supplement to on-the-job learning.

I would definitely recommend doing the chapter exercises to solidify your understanding. Nothing will cement your learning more than actually writing the code, seeing the results you obtain, and tinkering as necessary.

It would have been nice to see the later chapters focus more on advanced topics or common patterns in problem solving with SQL, which is the only reason I didn’t give it 5 stars.
253 reviews8 followers
July 10, 2024
Powrót do podstaw po wielu latach. Nie mogę powiedzieć, że przeczytałem tę książkę bardzo dokładnie. Skakałem po rozdziałach do miejsc, w których wiedza z wykładów, które były 18 lat temu, trochę się zatarła. Jest pewne piękno w czystej logice aplikacji w bazie danych. Jedna warstwa, zero abstrakcji, tylko czysta, zazwyczaj szybka egzekucja. Z drugiej strony brak testów, brak enkapsulacji, “zamknięcia” domen.

Lubię, gdy książka techniczna jest opowieścią. W tym wypadku tak było.

Kolejna oznaka, że się starzeję. Wracam do absolutnych podstaw i widzę małe detale, na które kiedyś nie zwracałem uwagi.
Profile Image for Julia Vasta.
2 reviews
October 29, 2021
So, so helpful. This is the best tech guide book I’ve read - the author gives the perfect amount of description for each function taught, and doesn’t rely too heavily on screenshots and long code blocks like some other books do. The purpose and value of Postgres functions is communicated clearly for a beginner to understand.
Profile Image for Martin.
92 reviews65 followers
May 1, 2020
Not only a good primer on data analysis with SQL but also a broad introduction to a lot of useful database features and tools. There is a very gradual increase in the difficulty of the topics which make them easy to follow up on and working with real-world datasets gives practical experience.
Profile Image for Alex Ott.
Author 3 books207 followers
June 21, 2018
between 3 and 4... Very PostgreSQL oriented... For beginners.
Profile Image for Midori.
69 reviews11 followers
April 7, 2020
This book is for beginners, however, the database management system the author uses is PostgreSQL. Well, then it's no so much suitable for beginners in my opinion.

22 reviews2 followers
June 4, 2020
Solid introduction to SQL, with a focus on postgres
Profile Image for Ben Stenhaug.
35 reviews1 follower
May 28, 2021
Best book I've seen for just go through it completely and you'll have most of the SQL knowledge you need.
Profile Image for Waits.
2 reviews2 followers
January 27, 2022
Great reference book for PostgreSQL, perfect to complement the documentation
1 review
April 25, 2022
From chapter 2 to chapter 12, the sql language could port to other ANSI SQL software. Not boring at all since as long as you follow along with the exercises, you will be challenge with the sql syntax. Each chapters cover an important facet of using the database system, like sign posts of a road map.
Profile Image for Johan.
1,234 reviews2 followers
April 28, 2021
An exhaustive introduction to SQL and PostgreSQL.
The amount of information is amazing and at times also overwhelming. I thought I knew a lot about SQL, but this book contained a lot of new stuff for me. I worked for a short while as a Oracle DBA in the nineties and used MySQL for a while in the noughties. The past couple of years I mostly used SQLite for personal projects. Compared to SQLite and even to MySQL the features of PostgreSQL are impressive.

Still, I found it hard to retain the abundance of information from this book. Is it too much? Is the information too dense? Should I have taken more time for this book? Should the book have provided more examples and exercises? Should I have created my own exercises? How did I study when I was in high school and college more than quarter of a century ago? I think I studied with a lot more repetition, made more exercises, took notes, and made my own summary.

It is an amazing book, but I should have approached it differently. I should have taken notes, repeated what I have learned earlier, and created some exercises of my own. That would have taken more time, especially finding datasets suitable for applying what I had learned in each chapter.

I intend on keeping the book close to use it as a reference manual.
Profile Image for Kristin Harley.
Author 5 books13 followers
August 12, 2025
I haven't even finished the book and I recommend it highly. In fact, the website includes resources, including code via GitHub, videos and an email to contact the author for questions. I did contact him today, and he answered within hours! (And yes, he was absolutely correct and I saw what I was doing wrong.)
It's not a given that the download instructions for the code environment always work in books like this, but this did for me, and they were easy to follow. I'm simply enjoying getting back into SQL so that I can apply this at work and also maintain my marketability. The book is so well-written, it's also enjoyable to read for its own sake, like reading a well-written book on mathematics or physics.
An excellent resource!
Displaying 1 - 30 of 31 reviews

Can't find what you're looking for?

Get help and learn more about the design.