As we progress through those first couple of chapters, we learn how to create objects in a relational database such as tables, insert data into those objects, and then query the database to get the data back out in a variety of forms. For example, you can in a query reformat the order of columns from a table or sort the data in particular ways.
And then Beaulieu builds on those basic blocks to explain how to use the different clauses of a query, from affecting query results using the "group by" and "order by" clauses to filtering queries down to only the data we want to see using the "where" and "having" clauses. Each section builds on what came before it. But what made this book flow for me was the fact that he gave reasons for why you'd use different parts of SQL syntax. For instance, I'd seen the "distinct" keyword used, but didn't really understand why. Now I know that the "distinct" keyword filters out any duplicates for the column with which it is used in a query. Very straightforward and easy to understand.
He also talks about how and why to use subqueries, which are queries contained within other queries. I've seen many extremely complex queries and always shied away from them because it was simply too much information to comprehend in most cases. But if you look at each subquery as a building block creating a virtual table that is in turn consumed by the query that calls it, it makes a lot more sense.
Beaulieu walks through joins, data, grouping, and so much more in this book. Each chapter and section makes sense on its own, but in the larger context it has managed to fill many of the holes in my understanding of SQL in a straightforward manner.
I would strongly recommend Beaulieu's Learning SQL, Second Edition for anyone doing database development. I can with certainty say that it takes care of so many of the mysteries of using SQL that it will quickly become indispensible on my own shelf.








Article comments