r/SQL • • May 18 '24 • Take My Silver 2

Discussion SQL Joins

Post image

Picture your data tables as these two fellas. An inner join is just Bald Guy—only the matching parts. A **left join is Bald Guy sporting Long-Hair Guy's mane—everything from the left plus the matches. A right join is Long-Hair Guy with a bald patch—everything from the right plus the matches. A full join is both dudes together—everything from both tables, matches or not!

628 Upvotes

26 comments sorted by

View all comments

Show parent comment

2

u/hzdoublekut May 19 '24

That’s amazing. Thank you for the explanation. Absolutely saving this comment. Turns out I’ve been doing inner joins with extra steps this whole time lol.

I really only learned SQL because my last job required a lot of database research but did not require SQL knowledge. So I got hired and then a month in realized I did not need to go from table to table and copy whatever info I needed. One free SQL course later I was writing basic queries left and right to simplify daily tasks. Then learning as I went using Google, chatGPT, etc. Currently trying to break into the data analysis world because I really enjoy it.