PURCHASE

The Art of PostgreSQL, one article at a time

The Art of PostgreSQL blog introduces PostgreSQL concepts that are useful for application developers. The content of this blog is either extracted from the published book, or written in preparation for book material. Reading this blog, you can enjoy The Art of PostgreSQL content one piece at a time!

Remember to practice what you learn here and elsewhere!

2019-09-07

The R in ORM

Ok, let’s face it, I like SQL. A lot. I think it’s a fine DSL given how powerful it is, and I respect its initial goal to attract non developers and try to build English sentences rather than code.

Also, I understand that manually hydrating your collection of objects in your backend developement language is not the best use of your time. And that building SQL as strings makes your code ugly. I get it.


2019-09-07

What is an SQL JOIN?

It took me quite some time before I could reason efficiently about SQL JOINs. And I must admit, the set theory diagrams never helped me really understand JOINs in SQL. So today, I want to help you understand JOINs in a different way, hoping to make the concept click at once for you too!


2019-09-07

What is an SQL relation?

If you’re like me, understanding SQL is taking you a long time. And some efforts. It took me years to get a good mental model of how SQL queries are implemented, and then up from the lower levels, to build a mental model of how to reason in SQL.

Nowadays, in most case, I can think in terms of SQL and write queries that will give me the result set I need. In most cases, because some parts of SQL are still complex, and I don’t practice as much as I used to. In particular, newer PostgreSQL features are areas I still need to work with more before I can integrate them in my daily workflow.

Today, I want to introduce the central concept of the SQL language. What is an SQL relation?