SQL JOINS Tutorial for beginners | Practice SQL Queries using JOINS - Part 1
HTML-код
- Опубликовано: 7 июн 2024
- This is the SQL JOINS Tutorial for complete beginners. In this video we shall cover INNER Join, LEFT Join and RIGHT Join. I’ll be posting the second part of this video next week where we shall cover FULL OUTER Join, SELF Join, CROSS Join and NATURAL Join.
Before we talk about different types of Joins in SQL, we shall first understand what are JOINS and why do we need them and then finally write some SQL queries to understand how to use them. We shall practice writing SQL queries using inner, left and right joins in this video.
Joins are the most fundamental concepts in SQL and having a clear understanding of Joins is very essential to write good SQL queries.
Timeline:
00:00 Intro
02:36 What are JOINS in SQL
05:30 Inner Joins in SQL
13:55 Left Join in SQL
19:59 Right Join in SQL
My recommended SQL Course: learnsql.com/?ref=thoufiqmoha...
Join my Discord Server: / discord
Join my FREE live SQL training session:
Batch 1 - Started on 03-Jan-2022 (08:00 pm Malaysian Time / 05:30 pm Indian Time)
Day: Monday, Tuesday, Thursday, Friday
Registration Link: www.lighthall.co/class/305d73...
Batch 2 - Starts on 17-Jan-2022 (09:30 pm Malaysian Time / 07:00 pm Indian Time)
Day: Monday, Tuesday, Thursday, Friday
Registration Link: www.lighthall.co/class/185a13...
Note: Both batch 1 and batch 2 will cover the exact same topics. Just the date and time are different based on the convenience of everyone.
How to Join the sessions:
1) Go to www.lighthall.co/
2) Click the subject "Data Science"
3) Find my session and click on it. The sessions will automatically start 4 mins prior to the scheduled time.
Please do subscribe and like this video if you found it useful.
🔴 WATCH MORE VIDEOS HERE 👇
✅ SQL Tutorial - Basic concepts:
• SQL Tutorial - Basic c...
✅ SQL Tutorial - Intermediate concepts:
• SQL Tutorial - Interme...
✅ SQL Tutorial - Advance concepts:
• SQL Tutorial - Advance...
✅ Practice Solving Basic SQL Queries:
• Practice Solving BASIC...
✅ Practice Solving Intermediate SQL Queries:
• Practice Solving INTER...
✅ Practice Solving Complex SQL Queries:
• Practice Solving COMPL...
✅ Data Analytics Career guidance:
• Data Analytics career ...
✅ SQL Course, SQL Training Platform Recommendations:
• SQL Course / Training
✅ Python Tutorial:
• Python Tutorial
THANK YOU,
Thoufiq
Left join = inner join + additional records in left table = best explanation I ever heard. Thanks!
Indeed.
The last 10 mins of your video truly clarified issues I had with joining "multiple" tables--beyond the simple two we so many times in tutorials and online course. Thanks so much for taking the time to reinforce these concepts!
the mvp of this video was the last join with 4 tables. exactly what i wanted to learn. the internet was filled with simple joins which never did justice to the concept of joins . industries will have 4-6 joins in a query and now i can visualize things way better. most helpful sql video seen all year. we must start small with learning but we must also learn complex stuff till it becomes useful in computer field
Teachers like you are so important to boost our confidence. Thanks a ton for making these videos, which are only helping us in flourishing our career. Loads of blessings
Thank you for your kind words Urvindar..
So glad this helped
You are awesome ur hardwork is amazing
You have done an amazing job of breaking these joins down, step by step, and making it simple to understand the differences. Thank you for such a thorough explanation. My professor could learn a thing or two from you.
I watched your SQL basis, intermediate, advanced and interview question videos. You are giving your best to all those categories. Thanks you so much for your efforts bro. Really appreciate your help. 🙏
Trust my word. You are the only one so far who really made SQL JOIN easy .
Wow, I just have to say that your videos are some of the best I've ever seen! this sql joins video was absolutely fantastic - your explanations were clear and concise, and I was able to follow along with ease. I've watched a lot of videos on this topic before, but none of them have been as helpful as yours. Thank you so much for taking the time to create such high-quality content - it's truly appreciated!
Agree
I have not understood SQL JOINS more clearly than the way you taught me. Thank you! I appreciate what you do.
Repeat this episode 2 to 5 times that would help you the concept and use your query window hand on write his code , I assure you definitely got it.
I found techTFQ is one of the best teachers as far I do experience!
Thank you.
Hi Thoufiq, I am only halfway through and I just have to tell you that you were born to be a teacher. Truly. Even though I’ve now taken so many classes on LearnSQL (per your video recommending that resource, which I really appreciate), so that this is material I know, this is such a great explanation of these concepts. I think what I appreciate most about you is that you include everything I need to hear and nothing I do not need to hear. You don’t waste your time or the viewer’s time with extraneous information. That is a very big deal on RUclips, where I come for information. I like to use my time well and you clearly keep this in mind when you put your videos together. This is my busy time now in my current job and so I won’t be around as much, but I’m so happy to again see that your channel has grown now to over 30K subscribers. I think that the combination of your skills, experience and knowledge combined with your humble spirit will serve and are serving you well. I wish you all the best for 2022 and many thanks for all of your assistance with SQL. 🙏🏻😊
It's always a pleasure to read your feedback Laura. I am so glad to receive your wishes.
And I imagined when I was making this video that it might relate to you. I am glad it did and I am glad you found this useful.
Thank you so very much for being a constant supporter of my channel and I truly wish you achieve all your goals for this new year :)
@@techTFQ do u take online live SQL classes?
@@techTFQ This is what a beginner always needs. Thanks man, you got a new subscriber !
have been using sql for years now and watched tons of sql videos, nothing came close to this explanation. After years of using sql, I was still confused with joins, but this video did it.. Thanks for this man, keep it up.
This is a very clear and simple explanation.I almost gave up and thats when I chanced to see this video. I cant believe that I finally learnt Joins! Thanks a ton
Thank You very much sir!
Your SQL basic, intermediate and advanced all the series are really very helpful and it's totally understandable
You explain all the topics very well
As an aspiring data analyst I can say this tutorials ✨😊 are helping me to achieve my goal
Glad I found this channel . You are doing a really great job man. Teaching is a skill which not everyone out there who is teaching have , but this man thoufiq , is a master at this.
Thanks a lot Aman. Feels great to read such feedback :)
Much appreciated!
Thoufiq bhai I was not able to understand joins concept from one year, but after watching this video i got cleared my all queries, wonderful teaching really appreciated.
The joins are much clearer now! Thank you for literally saving my life!!
I went through so many videos to learn joins and finally I landed here. Thank you so much for this. Your exceptional way of teaching can make learning easy.
Thank you so much 🙏🏼
Glad you liked it
I agree, he’s teachings are so easy to understand
I can strongly say that no one can teach this content in such short duration .Thank you for the valuable content
Thank you Manoj 🙏🏼🙏🏼
This guy was born to do this. Your simple method of explanation and clear demonstration is apt. Am catching the vibes, enjoying the groove. Lets go there...
Hi Thoufiq, browsing your videos could't agree more with others you are born a teacher, clear instructions I think your humbleness and the manner you teach is helpful to me and others. We are with you.
Thank you Rad .. I am glad to hear that
I have to agree 100% I have been trying to learn sql and python and felt lost and confused, anyone teaches it's hard to understand or they talk down to you. So happy I found your content.
Wow. Really enjoyed this. Joins was one topic which i was feeling hard to understand in depth. Thanks to this amazing video. I have got a clear idea now. Looking forward to the next one👍🏻✌️
Awesome bro 😍 glad you liked it
You are sooo right. I hated joins till I came across this video by luck. I missed out on a lot of opportunities because I did not have a good understanding on joins till now.
My American teacher has a way of making the lessons on “Joins” sound so complicated. Thank you for simplifying it sir. For the first time I’ve actually understood it.
I'm a newbie in SQL and presently taking a course on COURSERA. I got confused along the line and this video has cleared the confusion.
Thanks so much.
Hi Thoufiq, you broke down the concept beautifully into mini-concepts and explained it really well. Thank you!
Glad you liked it
This is how the content is delivered, how the teaching is done!
After going through a hell lot of tutorials on Joins, I can confidently say this is the explanation we beginners require!
Though One request I'd like to make. Could you please put the code of the tables you used in the tutorial. This will save our time, and we can focus more on practicing writing the queries itself.
Thanks a lot :)
Thank you very much Akash .. glad you liked it .. the scripts are already shared in my discord
totally agree....this video was a life saviour. Thank you Toufik
You have explained so smoothly n it's actually very easy to understand
Hi Thoufiq, I just want to thank you for this simple explanation on the JOIN concepts in SQL.
after watching so many videos on youtube on sql joins, Your video is perfect + simple + great and simple explanation without jumping the topic. many thanks Thoufiq :)
EPIC EXPLANATION. The level of clarity that I have on JOINS now is insane. Thanks!
Great to hear!
Amazing explanation, the best part is the practical query execution and tips given while executing them. Really loved it! Thanks 😄
Thank you Vipul .. I appreciate this feedback and that you noticed the details ☺️🙏🏼
@@techTFQ ...!.
Best youtube class ever, love how you took your time to explain.
I loved the video tutorial. Concepts are clearly explained. Way better than some tutorials on premium platforms.
I'm waiting for the video...1st like mine🤝👍sir
Awesome. Thank you buddy
WOWOOWOWOWOWOOW I REALLY LIKE HOW DID YOU EXPLANED LEFT JOIN AND RIGHT JOIN I LOOOOVE IT
Thank you buddy
Glad you liked it
Very well understood. Now I'm fearless from JOIN queries...😀🤗 Thank you so much for this video.
This is the best tutorial on SQL JOINS I have encountered. Thank you so much!
Many thanks for this detailed explanation of Joins. I can’t wait for the other part of the video. Notifications has been set.
Thank you James 🙏🏼
The unique thing about this join video is that it helps to understand when to use which join. Certainly boosting my confidence for counter questions on join in an interview.
Glad you liked it
You did an amazing job, brother, in simplifying the concept of joins to an extreme level.
I had so much trouble understanding joints, the way you have broken this down was very helpful, thank you.
Among First Viewers , Thank you Thoufiq for the efforts
Thank you bro for watching
Outstanding explanation
99099
Commenting after one year as I watched it full now 😅
Love it after 31.12
Cleared a huge confusion
Hi can you share the dataset which you have explained in the video
Amazing quality man..u have taken my SQL to next level that too for free❤❤❤❤
Awesome Shiv , glad you liked it
This is how the content is delivered, how the teaching is done!
this is the best video on joins I have ever come across on YT
Excellent teaching
Your work 👏👏👏
Thank you! 😃
Hi Sir,
Earlier I was struggling to get fetch data from 3 three tables, now after watching your 2 two videos several times now I am confident enough to solve any query of SQL... no. of tables doesn't matter. Bunch of thanks for everything Sir.
Now I am targeting windows functions, I never thought I will write such queries but Sir, the way you teach is just amazing 😍😍
Thank you so very much for leaving this feedback bro.. means a lot to receive such amazing feedback 🙏🏼
I had the same problem man. So easy to understand.
What a video :) you explained things so completely and so well that I had no questions at the end. Amazing job!!
I’ve watch many videos and none has been as easy as this one. Thank you. Wonderful training.
Glad you liked it :)
Many thanks sir, I was looking for this one since a long time
Glad I could help
Good content 👌
Thank you Saha 🙏🏼
So well explained, I wanted to brush up my skills and this video goes to show with various scenarios to understand JOINS better which most professors just explain the skeleton and let it go , thank you for your hard work put in this video and helping us! Learning better!!
I have been doing sql for years but never quite understood joins as i now understand after watching this video for just a few minutes. Thank you!
Tracy come and teach me😢😂
This is video is quite helpful. You have given answers to a lot many questions that i had. Thanks a lot 😊
Also could you please tell how to create the team_member_id column which has two FOREIGN KEY references in the same column?
Thanks in advance 😊
Good Explanation . Thank you
Glad it was helpful!
Honestly... the most descriptive and explanatory video I have come across. Thank you for making joins so easier to do and understand. Keep up the great work
I agree
Dude...Great video. I don't think anyone else has a better video on this topic.
YOU ARE THE BEST
Thank you buddy 🙏🏼
@@techTFQ it's really good ❤️
very good clear explanation, can you please share the scripts for creating the tables and inserting the data for the explained tables, if we follow the same tables and same data it will be better, Thank you....
Thank you 🙏🏼
I had shared the scripts in my discord server, perhaps you can join my discord server to get those scripts.
Link to join my discord can be found in video description
wow! From now I will never be confused about joins
Hi Taufiq, I just started a crash course in SQL query through work taught by someone from work and I was so lost and frustrated because I couldn't even get the basic concept of the Select or any of the main Join statements. You made it so simple and perfect to understand how to run a query. Thank you so much. I was wondering if you have lessons on the WHERE and the different SQL Functions lessons.
Awesome..appreciate your efforts to create such precise and clear contents👏
Thank you 😍
Agreed✨
If there are two tables for example employees & Department and you are getting your desired output using left join. If I exchange the table position and used the right join then output will be the same. Then what is the use of left or right join?
For example:--
Select e.emp_name, d.dept_name
From employees e Left Join department d On e.dept_id = d.dept_id ;
Same output with query below.
Select e.emp_name, d.dept_name
From department d Right Join employees e On e.dept_id = d.dept_id ;
Please answer it was asked in interview
@Muhammad Zahid I’d like to know which query is more efficient for the system to run. One with join or with a subquery or does it vary from case to case? Or is there a general rule about this. Would be curious if @TechTFQ has time to answer us. I love this channel! 😀 I would also like to know the answer to Sachin’s question, from the interviewer’s perspective at least.
The reason why we need both LEFT and RIGHT join is because in certain scenarios, you may have to write some query where one specific table might be on the left hence you will need left join and then some other table may be on the right side for which you would need right join.
Now this explanation may not convince you hence consider the below example:
In my video, the last query I wrote was to fetch ALL emp, dept, manager and project details..
Imagine, instead of this, if the requirement was to fetch ALL emp, dept, ALL managers and project then for such cases we would need to use both left and right join together.
Sample query below:
-- Fetch details of ALL emp and ALL manager, their department and the projects they work on.
select e.emp_name, d.dept_name, m.manager_name, p.project_name
from employee e
left join department d on d.dept_id = e.dept_id
right join manager m on m.manager_id = e.manager_id
left join projects p on p.team_member_id = e.emp_id;
Subqueries and Joins are 2 different things.. we should not mix them.
Joins can be used everywhere even inside a subquery.
I tried to explain the reason why we need both left and right join in above comment. Hope that clarifies Zahid..
I tried to answer it in above comment Laura. Hope it clarifies :)
As for more efficient query, it depends on many other factors. The way how you form your query plays a big role in performance too.
@@techTFQ thank you, that makes it very clear! 🙏🏻🙏🏻🙏🏻
After almost 6 years in industry finally found someone who know how to teach SQL in easy way
This is amazing! Always struggled to learn joins, never thought this video would give me so much clarity.
Wow! what a wonderful explanation, my long time confusion and queries got cleared, you are awesome, Bless you
I saw the whole video and you explained everything perfectly . Thank you so much ! Really appreciated! I spent so much time studying and still I have the feeling I am not getting anything right .
I was really sad today. Thank you for explaining so clearly and detailed ! 🙏🏼🙏🏼🙏🏼🙏🏼🙏🏼🙏🏼
I know you've heard this for the umpteenth time but allow me to reiterate that you're the best! Thank you
I seen multiple videos on SQL joins and This is the best video to understanding joins completely really excellent explanation.
I'm soooo happy I came across this video!! I'm a fresher and still struggle with JOINS and this was the most helpful video I've watched in MONTHS!! You made it easy to understand. THANK YOU Thoufiq!!!
Super glad to know this helped ☺️
Hey
I have been looking for some good options to learn joins and suddenly your videos came in my suggestions and booom!! my doubts are super cleared now.
Thanks mate!
such an underrated channel, these videos are so easy to understand! thank you so much!!
Thank you very much for a great video. It was very informative and your explanations were very clear! I'll be referring back to this video again as there was so much content. I'm already looking forward to part 2!. Thank you again!
Excellent video this is not just for a comment's sake. This is what I felt while I was watching, moreover, the content was super clear.
Great explanation. 8 years experienced here, wanted to revise sql joins for a small project. This video really helped.
Thank you Ruchi..
Glad to know that even an experienced professional like you is benefiting from this content 🙏🏼
No one can teach joins better than you. thank you so so much for doing this. This is helpingso many new learners like me. I a going to go through the whole course work
The best i have ever seen u made me realize that these topics are so easy and anyone at a basic level can master it !!
Thank you very much, this is very clear now for me and now I really understand joins better. I can't wait to put this into practice.
teachers like you can trained anyone..super
Excellent teaching skills thoufiq, even 2PUC student can learn complete Sql concept. I will recommend my juniors to watch and learn from this channel.
Hi Thaufiq, your video was incredibly informative and presented with impressive clarity. The detailed explanations made understanding the topic a breeze. Well done!". Thanks a ton 🙏
You r definitely a Good Teacher.. No doubt after watching this crystal clear explanation.. I will recommend my friends too.. May Allah Bless you and grant you success in all your endeavors for helping us.. 😊
Thankyou so much for providing this awesome lesson for free.The way you have taught is just fab
Your are the great teacher.. I have 3 yrs experience in sql.. Now I got more clear in joins thank you bro 😊
Thank you Lionel .. glad this helped
WOW that was breeze like Explanation...thanks Toufiq....Respect from INDIA.
Just wow! Very well explained.Thank you so much for sharing your knowledge❤️
Thank you so much!!Your videos are helping me to understand the difference between the different kinds of joins quite well.
Your explanation is very Crystal Clear, God bless you and continue the same spirit
This is mind blowing info, ah ha moments all the way through. He simplified joins to the next level. Thank you!!
I am a complete beginner in SQL , JOIN was a tricky topic to understand, but u made it very simple to understand, thank you Thoufiq , you are awesome 🥰🥰🥰
Glad to hear that Abhishek ☺️
One of the best explanations of sql joins on youtube THANK YOU
Best SQL tutorial channel on RUclips 💜❤️
Hello sir, you are simply amazing .thank you for your videos. I don’t know anything about sql after seeing your videos I lost my fear and I am able to write queries. Thanks for all your efforts. Please educate us . We are blessed to have you like this teacher. Your explanation is very simple and easy understanding 😊😊
Your explanations far better than my lecturer .. thank you sir 🤝🏻💥 now I’m on the track
Great Execution. I was confused in this topic but you have solved all my queries related to joins 👍
Loved this video. It's a very well put off basic join concept in a single video.
Awesome man, lot of thanks to you. Clear & crisp. Looking forward for more SQL topics.
Your welcome buddy..
This tutorial is absolutely brilliant mate. Thanks for sharing 👍🏽
This video is really very helpful to understand the difference between joins and when it should be used , thanks sir
Officially the BEST explanation on SQL JOINS online! WHERE Thoufiq = "awesome";
Thank you so much big brother
I always scared of join concept but after watching your video i feel so comfortable with join thank you again ❤️
Ur rocking man..... Clearly u explained it😇👑❤🔥