r/learnSQL • u/souroexe • Nov 09 '25
How to get good in Joins ??😭
Sql joins are really confusing for me to get how to get good at it any suggestion ??
18
Upvotes
r/learnSQL • u/souroexe • Nov 09 '25
Sql joins are really confusing for me to get how to get good at it any suggestion ??
11
u/Mastodont_XXX Nov 09 '25
Practice makes perfect.
9
u/Massive_Show2963 Nov 09 '25 edited Nov 10 '25
This tutorial, takes you through practical examples of using Entity Relationship Diagrams to model your data structure and provide a solid foundation for using JOINS.
It provides hands-on practical examples with real-world data.
You will learn how to use SQL syntax to write INNER JOINS and LEFT JOINS.
Introduction To SQL Joins
You should take a look at some examples of databases that can be downloaded that contain table joins.
The best way to learn is simply by creating joins yourself.
Microsoft's Northwind and Pubs databases have been used for a while as instructional databases.
See download from GitHub:
https://github.com/microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs
2
u/[deleted] Nov 09 '25
Practise is the only solution but from where? Leetcode has high level questions, basically for clearing interviews
2
u/hobbyoftakingphoto Nov 09 '25
Start by using join of foreign key of the selected table with primary key of the table from which you want to get extra columns like name. If there is no data even if there data in first table, that means you need to use left join.
1
u/diablo01010 Nov 09 '25
Always run select * so, after every join, you can understand the visualisation. After that, try answering the where statement(or condition that is asked).
PS. For me, what sucks the most is cross join queries😭
1
u/mnemonikerific Nov 09 '25
Can you give an example where it was confusing
1
u/Admirable_Bother_617 Nov 09 '25
left table is the one written on left side of = sign
3
u/[deleted] Nov 09 '25
[removed] — view removed comment