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!
As we saw in the previous article What is an SQL relation?, in SQL a relation is a collection of objects, all sharing the same definition.
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.