Babblings about Systems Administration.

Bring Your SQL To The Next Level

When you start learning SQL and databases it is trivial to find good resources. My adventures started with ORACLE8i The Complete Reference. Tutorials are another way. With the official documentation for your RDBMS on hand you can learn the specific dialect of SQL you need. Later in your career you might cross the way of an SQL guru. In that point in time you wonder: How can I reach that level? I met quite a few over the years. Questions for recommendations stay often unanswered. Those guys breath SQL day in and day out. Most of their tricks they learned by practice. After some time consuming research I found a few books which brought me to the next level.

I often hear complains about the age of some books. To be honest with you: The mantra that the computer world is a fast changing one is a lie. Yes. There are a lot of moving targets. But we have a lot of technologies which are only changing slowly if at all. At least if you don’t look under the hood. UNIX, Linux, protocols like SNMP, HTTP, programming languages. A lot of tools are around for more than 20 years. So even from a book written 10 or more years ago you can learn a lot.

But let’s go through my list! In the beginning you need recipies for the problems in front of you. Don’t look further than the SQL Cookbook. Over 600 pages for most of your daily problems. I use it on a regular basis to solve the problem i have right now. SQL is just one side gick for me and my memory is not very good. No shame for using it side by side with your editor or SQL frontend.

As human beeings we tend to make all the same mistakes. To avoid some of them read SQL Antipatterns: Avoiding the Pitfalls of Database Programming. With 329 pages it wont take much time but will give you time back with the lessons learned.

More lessons with a practical background you will find in The Art of SQL. 370 pages giving you lots of thoughts. I am the first to admit that I had to read a few pages twice. Probably not a bed time lecture if you want to learn from it.

If you know a book missing in this list feel free to contact me. And always keep in mind: Some SQL statements are written in a day and not a minute. If they run often, are fast and deliver the right result it is well spend working time.

<2022-10-15 Sat 18:22>

Two years have passed and I am still learning SQL. Shortly after I wrote this blog post the 2nd edition of SQL Cookbook came out. It got enough updates to qualify buying it again.

As Vertica is my main platform I got a copy of Making Databases Work - The Pragmatic Wisdom of Michael Stonebraker. It is not much about writing SQL but gives a brief history of databases. Starting in the 70s it gives some background around relational databases in general as well as insights into Ingres, Postgres, PostgreSQL, Vertica and others. Most chapters are easy to read because they tell you the circumstances. Others explain internals of the systems and algorithms. You get a better understanding how everything evolved over time and appreciate the technology.

For the next year I see a lot of database design heading into my direction. Luckily I got pointed to Kimball’s Data Warehouse Toolkit Classics 2nd Edition. The first book I could skim read. But the Data Warehouse Toolkit requires more time. The Data Warehouse Lifecycle Toolkit is no difference.

Hopefully as a shortcut I started reading The Kimball Group Reader: Relentlessly Practical Tools for Data Warehousing and Business Intelligence Remastered Collection. A collection of blog posts and articles. Still with 912 pages a lot of paper.

If your background is Data Analyses and you wonder what’s about this SQL thing you should get a copy of SQL for Data Analysis: Advanced Techniques for Transforming Data into Insights. Cathy Tanimura spend some extra time creating a GitHub repository. If your background differs it might help you understanding how data analysts tick.