Alexander Obregon's Substack

Share this post

User's avatar
Alexander Obregon's Substack
Combining Tables With JOINs That Actually Match What You Want
Copy link
Facebook
Email
Notes
More
SQL

Combining Tables With JOINs That Actually Match What You Want

How to write joins that don’t backfire

Alexander Obregon's avatar
Alexander Obregon
May 28, 2025
∙ Paid

Share this post

User's avatar
Alexander Obregon's Substack
Combining Tables With JOINs That Actually Match What You Want
Copy link
Facebook
Email
Notes
More
Share
Image Source

Joining tables is one of the most common things you’ll do when working with a database. But there’s a big difference between just writing a JOIN and writing one that actually returns the rows you meant to get. Most guides give you the surface-level difference between INNER and OUTER joins, but they rarely cover how the actual rows behave when you mix in filters, missing matches, nulls, and real-world data.

Share Alexander Obregon's Substack

What Really Happens When You JOIN Tables

Not every join gives you the result you thought you’d get. The way databases match rows is mechanical, and if you’re not careful about what goes where, the output can shift in ways that don’t always make sense at first. Before getting into real-world joins, it helps to know exactly what the engine does during that matching process.

Keep reading with a 7-day free trial

Subscribe to Alexander Obregon's Substack to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Alexander Obregon
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More