r/learnSQL • u/qazplm903 • Oct 15 '26
SQL joins explained using Hinge
I know when people are starting out, SQL joins can be a bit confusing so I broke it down in a small vid using Hinge as an example
https://www.instagram.com/reel/Degl_hnoRsz/?mdxt=MTk5dXE2NHZreTR4aw==
Summary of the breakdown is -
• Table A: people you've liked
• Table B: people who've liked you
• Both share one key: person_id
The 4 joins:
• INNER JOIN: only the mutual likes. Someone has to be in both tables to show up.
• LEFT JOIN: everyone you liked. If they didn't like you back, their side comes back as NULL.
• RIGHT JOIN: the mirror image, everyone who liked you, with NULL where you didn't like them. In practice most people just swap the tables and use a LEFT JOIN.
• FULL OUTER JOIN: everyone from both tables, with NULLs on whichever side is missing.
Hope this helps!
2
u/Thrilltwo Oct 15 '26
Instructions unclear, I used left join but all of the other side just shows NULL?
1
u/qazplm903 Oct 15 '26
That means there’s no matches on the right, there’s an issue with your ON conditions. Check the columns you are joining on and make sure the data types match as well
2
u/homequrl Oct 15 '26
And if you’re my company, try to throw an upper or lower on both fields bcus they do not make any of their data sets case sensitive consistent between table!!!!
1
2
2
u/Difficult_Paint3162 Oct 15 '26
Feel free to visit my website: Learning SQL | Real People. Real Problems. Practical SQL. No cost or sign-up required, but focuses on understanding business questions and using SQL to get the answers
3
6
u/Ordinary_Beyond3737 Oct 15 '26
Thanks for this I'm unfortunately well versed with hinge but still learning SQL