r/learnSQL • u/sam_vstheworld • Jun 06 '26
SQL JOINs
Hello, people! I am facing one issue, I am having troubles in understanding Left, Inner, outer joins.
I watch a video or go on datalemur, at the beginning it looks simple then when I start practicing i become confused.
What should I do? How should I practice the Joins to have a better grasp of it?
37
Upvotes
11
u/Eleventhousand Jun 06 '26
An inner join means both tables have to have data in matching criteria for its rows to show up in the results.
An outer join means that just one table has to have data in the matching criteria for its rows to show up.
Left, Right and Full are different types of outer joins. They indicate which of the tables is the one that always has its rows show up. 99% of the time, Left is used. This means that the table in the From clause will always have its rows show up.
4
u/squadette23 Jun 06 '26
Here is a guide to SQL joins that I wrote: https://kb.databasedesignbook.com/posts/sql-joins/
It takes a different approach compared to most existing texts:
Try and see if it helps.
1
u/One9triple0two Jun 07 '26
Watch data with baraa
2
u/Massive_Show2963 Jun 06 '26 edited Jun 06 '26
Its easier to visualize a join if you have a Entity Relational Diagram (ERD) to view.
This will show how the various tables are connected.
I create this tutorial that will walk you through practical examples of using Entity Relationship Diagrams to model your data structure and provide a solid foundation for using JOINS.
Introduction To SQL Joins
1
u/BisonSpirit Jun 06 '26
I know exactly what you mean. In principle it makes sense but when you apply it, it becomes confusing. I’m currently on the same challenge and I think the best way to understand is to solidify your understanding of the concept, and then repetition of JOIN query’s to really understand.
At first I used Venn Diagram imagery to make sense of it, but I still get lost. The attached Gemini answer is somewhat helpful. But yes- practice practice practice
1
u/[deleted] Jun 07 '26
[removed] — view removed comment
3
u/[deleted] Jun 08 '26
[removed] — view removed comment