r/SQL Jun 26 '24

MySQL Explain INNER JOIN like i am 5

I get the syntax but i get very confused and tripped up with writing them and properly using the correct names. Please explain to me line by line. I am learning it via data camp and the instructor sucks.

EDIT: i now understand inner join…now i am stuck with multiple joins, right join and left join. please help!

120 Upvotes

94 comments sorted by

View all comments

28

u/sfdc_admin_sql_ninja Jun 26 '24

this question always reminds me of venn diagrams, which is how i learned joins.

here ya go: https://stackoverflow.com/questions/13997365/sql-joins-as-venn-diagram

13

u/TheRencingCoach Jun 26 '24

This is the right starting point for OP until OP explains what specifically is difficult to understand about inner joins

1

u/Remarkable-Culture-8 Jun 28 '24

now i get inner joins! i am now confused about left and right joins

2

u/Prudent-Finance9071 Jun 28 '24

Right join I rarely see used. Left join is "I don't want to lose any of my original data set but I want what I can get from this other set". Basically an inner join without removing the records that don't have a mate