Relational Foam - Learning Inner and Outer Joins the Hard Way

Опубликовано: 20 Май 2026
на канале: Stale Branch Records
71
4

I think this is among my favorite ones. For the topic, this is probably the only one about data (I wond in data), and for the music.

It was also one of the first one I created and I was still learning how to use suno.ai to generate the music, the fact that I was able to force the rythm in certain part of the song was quite cool.

From the album "A Brief History of System Failures – Vol. 1"
Released by Stale Branch Records.

--- Chapters
0:00 Cover
0:04 Song starts
0:18 Why we use SQL
0:30 Learning our limits
0:49 What is a Left Join
1:04 How to use it
1:15 Troubleshooting
1:27 Why we use Outer Joins
1:56 Let's recap
2:23 Caveat and next steps

--- Lyrics
One... Two...
Wait.
Is the server up?
Okay, four!
It’s been one week since I ran the report
And realized the summary was coming up short
I was pulling from the prod env with a narrow intent
But I lost 40% of the money they spent.

I am a junior, I am dreamer, I am a query redeemer
But the inner join logic turned me in a screamer
because the keys didn't match and the records didn't latch,
And I’m digging through the bin for the data I didn't snatch!
I’m staring at the dashboard, it’s a ghost town view...
I’m looking for the many, but I only find the few...
(So few!)

Oh, you gotta Left Join! (Don't drop the row!)
You gotta let the Nulls show you where the users go!
You can’t just Inner Join if the story isn't whole
You’re gonna lose the heart and you’re gonna lose the soul
Of the dataset!

Yeah, keep the Left Side steady and the Right Side loose
Stop squeezing all the data 'til there’s no more juice!
Check-the-table-check-the-query-check-the-database
I’m looking for the rows but I’m losing the trace
Is he in Table B? Is she in Table C?
If they haven't made a purchase they’re a mystery to me!

I used to think a Null was a mistake in the plumbing
But it’s just a silent guest who saw the party was coming
And decided to stay home! (He decided to stay home!)
Now I’m mapping out the ghosts in the relational foam!
I’ve got the schema! (He's got the schema!)
The data is clean-a! (The data is clean-a!)
I’m a data scientist, not a data-omissionist
I’m a multitable-joiner-rows-conservationist!

Oh, you gotta Left Join! (Don't drop the row!)
You gotta let the Nulls show you where the users go!
You can’t just Inner Join if the story isn't whole
You’re gonna lose the heart and you’re gonna lose the soul
Of the dataset!

It’s all there now... the buyers... the browsers...
(Left Join!)
(Left Join!)
Wait, why is the row count three millions?
I didn't do a Cross Join.
What do you mean a Cartesian Product?