SQL JOINS Interview Question | What does different SQL Joins return?

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ค. 2024
  • Given 2 tables, identify the no of records returned using different type of SQL Joins. This is a very frequently asked SQL Interview questions especially when a recruiter wants to test your knowledge on SQL joins, this is the kind of questions you can expect.
    In this video, we shall look at 2 different datasets. Each dataset contains 2 tables which has duplicate data, null values etc. You are required to identify the no of records returned using INNER Join, LEFT Join, RIGHT Join, FULL JOIN, Natural Join and Cross Join. And you need to answer them without querying the tables.
    Hence in order to answer such questions, you need to understand clearly how SQL internally performs different type of joins.
    Download the dataset used in the video from my blog. Link below:
    techtfq.com/blog/sql-joins-in...
    Timestamp:
    00:00 Intro
    00:48 Understanding dataset from Scenario 1
    01:35 Understanding INNER JOIN
    06:03 Understanding LEFT JOIN
    09:48 Understanding RIGHT JOIN
    12:03 Understanding FULL OUTER JOIN
    14:33 Understanding CROSS JOIN
    15:58 Understanding NATURAL JOIN
    19:35 Answering all JOINS result from Scenario 2 dataset
    🔴 My Recommended courses 👇
    ✅ Learn complete SQL: learnsql.com/?ref=thoufiqmoha...
    ✅ Practice SQL Queries: www.stratascratch.com/?via=te...
    ✅ Learn Python: codebasics.io/courses/python-...
    ✅ Learn Power BI: codebasics.io/courses/power-b...
    🔴 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
    ✅ Git and GitHub Tutorial:
    • Git and GitHub
    ✅ Data Analytics Projects:
    • Data Analytics Projects
    THANK YOU,
    Thoufiq

ความคิดเห็น • 555

  • @archkrishna147
    @archkrishna147 ปีที่แล้ว +213

    Have seen so many SQL videos on joins, no one has explained it like you. Will never forget the concept. Thanks so much for your hardwork and effort.

    • @thepratikjoshi44
      @thepratikjoshi44 ปีที่แล้ว +8

      Couldn't agree more

    • @KevinElevates
      @KevinElevates ปีที่แล้ว +1

      @@thepratikjoshi44 +1

    • @abhi_updates
      @abhi_updates ปีที่แล้ว

      @@thepratikjoshi44 y so ?

    • @ramkan2478
      @ramkan2478 ปีที่แล้ว +3

      Very true.

    • @ardianthaputera6970
      @ardianthaputera6970 ปีที่แล้ว +2

      indeed, this video practically settles it all. I can be sure that I now understand SQL joins

  • @TussharPatnaik
    @TussharPatnaik 10 วันที่ผ่านมา +1

    Explanation is "at par". I don't think I'm gonna forget this JOINS concept in this lifetime. Thanks Taufiq !!

  • @sampadatamhankar4429
    @sampadatamhankar4429 หลายเดือนก่อน +1

    I generally dont comment on any videos, But I have to say i will never ever be confused about joins here onwards!! Gratitude!!

  • @harsha8761
    @harsha8761 ปีที่แล้ว +52

    The way you explain SQL even layman can understand SQL kudos to your explanation

    • @techTFQ
      @techTFQ  ปีที่แล้ว +4

      Thank you very much bro

    • @kumar-vu6xy
      @kumar-vu6xy ปีที่แล้ว

      Great help 😊 sir

    • @tietan867
      @tietan867 ปีที่แล้ว

      I totally agree. It’s very clear. I would like to learn all filer/ criteria such as exclude some data in the table. Can you share the video? Thanks

  • @abhisheknakate9347
    @abhisheknakate9347 ปีที่แล้ว +2

    The way you explain joins is more concise than any of the SQL videos I've seen... I finally understand how Joins work .... thanks to your explanation..!

  • @sureshsekar6788
    @sureshsekar6788 11 หลายเดือนก่อน +8

    I never seen this kind of clear explanation. After 7 years I am clear join concept. Thank you so much.

  • @priyankachaparala2360
    @priyankachaparala2360 ปีที่แล้ว +3

    Before I was very confused with JOINTS but after watching the video with the formulas, examples and explanation I’m very much clear now. Hat’s off and thank you.

  • @dracoreeper
    @dracoreeper 4 หลายเดือนก่อน +3

    I just came across this video, i figured out a internal logic of this on my own, did not know that this video existed. proud of figuring that out now

  • @vikramamin2853
    @vikramamin2853 ปีที่แล้ว +5

    I have seen quite a few videos on Joins but this is probably the simplest and easiest way of understanding Joins. Kudos!!!
    This will help in explaining joins in an Interview.
    Keep up the good work 😀

  • @jagnyaseni4910
    @jagnyaseni4910 ปีที่แล้ว +2

    I was searching for this type of join video with example from so many days . Thank you for how wonderfully u have explained...I didn't find anyone who is explaining like you... 🙏🙏

  • @MdRizwan-uu9dv
    @MdRizwan-uu9dv ปีที่แล้ว +1

    The way you explain the concepts it becomes easier to understand. which shows that the effort and hard work you put in to master the SQL.

  • @technicalraman8848
    @technicalraman8848 ปีที่แล้ว

    Salute Sir. I watched hundreds of videos on sql join but only ur video clear all concepts on Joins. Salute Sir.

  • @khalid0669
    @khalid0669 ปีที่แล้ว +3

    I love how you explain how SQL works, It's so clear anyone can understand it. I'm hoping that your next video would be on SQL optimization?

  • @hnaidu.pro21
    @hnaidu.pro21 ปีที่แล้ว +1

    Cannot be more comprehensive than this. Thank You so much, Taufiq.

  • @vasanthalakshmi2049
    @vasanthalakshmi2049 ปีที่แล้ว +2

    Thanks , searched for this content forever and finally after so long u made this video, one of its kind in most basic rules , really appreciate and please keep doing more of these videos, also nice that duplicate removing video has been made 😀

  • @shantanumandal2930
    @shantanumandal2930 ปีที่แล้ว +10

    Please keep posting interview questions and concepts like these frequently..these are very helpful..and please start tutorials on power bi also if possible..❤️

  • @nimeelyamattluru2459
    @nimeelyamattluru2459 ปีที่แล้ว +1

    I have come across so many SQL joins video but this has very keen explanation ,we cannot forget that in life time Thank you for your valuable teaching

  • @Devrajsingh-ow7pr
    @Devrajsingh-ow7pr ปีที่แล้ว +60

    FORMULAS FOR JOINS
    💢
    INNER JOIN = Inner join will only fetch the matching record from the opposite table you mentioned.
    LEFT JOIN = Inner join + fetch any additional records from the left table which is not present in the right table.
    RIGHT JOIN = Inner join + fetch any additional records from right table which is not present in left table.
    FULL JOIN = Inner join + fetch any additional records from left table which is not present in right table + fetch any additional records from right table which is not present in left table.

    • @isaitech4602
      @isaitech4602 ปีที่แล้ว +2

      TQ devraj

    • @radheyyyyyyy
      @radheyyyyyyy 9 หลายเดือนก่อน +1

      that was an ez and understandable explanation to grasp the concept at once :D

    • @gilbertmutai8413
      @gilbertmutai8413 8 หลายเดือนก่อน +3

      Cross Join = Match each record in the left table to each record in the right table Irrespective of the values.(Number of records in the left table * Number of records in the right table)

  • @priyanshipundir55
    @priyanshipundir55 ปีที่แล้ว

    Seriously , You are best SQL teacher i have seen ever.

  • @shlokvishwasrao2504
    @shlokvishwasrao2504 ปีที่แล้ว

    I was just watching this video randomly,just to brush up my concepts but I'd like to admit one thing for sure that when I learnt joins for the first time,I learned it in the Hard way.This is just some Brilliant stuff with extraordinary explanation👏

  • @NawazKhan-go3fj
    @NawazKhan-go3fj ปีที่แล้ว +13

    Man you've explained exactly what i needed to know. You've no idea how relieved i feel after finally understanding the concept of joins. I needed to understand how sql works with each record of each table and you've explained that really well. Thanks a lot brother for this video. I'll definitely subscribe to your channel.

  • @seymur.halley
    @seymur.halley ปีที่แล้ว

    I swear to God this explanation of Joins is the best one I've ever watched

  • @shrutisharma1434
    @shrutisharma1434 24 วันที่ผ่านมา

    This is one of the best videos on joins. I cannot thank you enough for this. 😊

  • @tenacity8281
    @tenacity8281 10 หลายเดือนก่อน

    Most Helpful video ever. I have been trying to study SQL for the past 6 years and no one and I mean no one from Kudvent to Udemy Courses taught this concept so beautifully. Thanks a lot. can't thank you enough,.

  • @jatinagg8221
    @jatinagg8221 ปีที่แล้ว

    Kudos to you man . The way you explain will imprint in memory for long . I have seen many videos even if we doesnt know underlying concept but way you explained it was easier to grasp the working of solution. Keep sharing such amazing content.👌

  • @rameshthanikonda7027
    @rameshthanikonda7027 ปีที่แล้ว +9

    Hats off Toufiq. No one can explain better than this. We have a great teacher in the form you, who will help us with more information even for the small inputs which we have given to you. Kudos 👌👌🤞🤞. Thank you once again...

  • @mytamilchannel977
    @mytamilchannel977 ปีที่แล้ว +1

    I got this same question in my interview 5 years ago!! 👍👍very good explanation! Thank you!

  • @ajinkyaadhotre5336
    @ajinkyaadhotre5336 ปีที่แล้ว

    man this video was simply awesome ! made me super confident about joins for my upcoming SQL interview !

  • @G-R-O-O-T
    @G-R-O-O-T ปีที่แล้ว

    Hi sir,
    I was not able to get clear understanding about joins even I've watched and referred so many websites and TH-cam videos but finally I'm very glad and confident about joins after watching this video the way you explain with formula makes the whole scenario easy.
    Thankyou so much for making great efforts to make the concepts understand easily

  • @crazydot81
    @crazydot81 9 หลายเดือนก่อน

    Very explanatory and reasonably short. Your videos are top ones. Great thanks!

  • @bhumikamandavia7030
    @bhumikamandavia7030 ปีที่แล้ว +2

    I quite get confused with all the JOINS especially working with large data sets. The way you explained the JOINS is quite commendable especially the formula you have mentioned. I dont think I will ever forget this concept now. Thank you so much!!🙏

  • @yshu1631
    @yshu1631 หลายเดือนก่อน

    Thank you so much no one other has explained it so well it has been around 3 months i was learning SQL but got to know today that my understanding for inner join was very wrong .
    Feeling glad that i came across you tutorials

  • @priyajamuna5403
    @priyajamuna5403 ปีที่แล้ว

    Very clear I came across many SQL videos but this one could able to understand the right concept.

  • @saisanthoshthota7687
    @saisanthoshthota7687 ปีที่แล้ว

    This is called a true education.... Thanks is a small word...❤❤

  • @ravikantkumar7502
    @ravikantkumar7502 ปีที่แล้ว +1

    Likes * Infinity.
    Very Simple and easy to understand. also providing the tables is a great idea as anyone can practice it without getting lazy to write insert query.

  • @Khansarah
    @Khansarah ปีที่แล้ว

    This was seriously needed. After watching this video my all doubts in joins got clear .

  • @basavaj474
    @basavaj474 ปีที่แล้ว

    Have been seeeing so many sql videos to learn joins but no one can teach like this❤ kudoooooooos🎉

  • @muthusamyperiyasamy5306
    @muthusamyperiyasamy5306 ปีที่แล้ว

    Asked similar question in my recent interview (inner, left, right, full outer, union, union all, intersect, minus). Thanks for sharing this video

  • @srinivasv3282
    @srinivasv3282 ปีที่แล้ว

    This is my default question from last few years to all whom I interviewed to find if they are good at fundamentals.

  • @rajathratnakaran7893
    @rajathratnakaran7893 ปีที่แล้ว +1

    I bet no interviewer can confuse me with this sort of question anymore. Thanks TFQ!!

  • @unnatijaswani4832
    @unnatijaswani4832 ปีที่แล้ว +4

    Awesome session @Toufiq! Ur videos are always really informative!! I was asked 2nd scenario in an interview & at that time, I did not know that 2 nulls are never same & I gave the wrong answer. 😒 Hats off! 👍💓😍😍😍😍😍😍

  • @gzuzchuy505
    @gzuzchuy505 ปีที่แล้ว

    I always learn from your tutorials...Thank you so much for the good work!

  • @raghavindersirkha6563
    @raghavindersirkha6563 8 หลายเดือนก่อน

    best way to explain joins i will never forget them in life time now

  • @relaxwithxane6878
    @relaxwithxane6878 ปีที่แล้ว

    Trust me i got this concept cleat after alot of months. Bro u rocks.

  • @anismangure8536
    @anismangure8536 ปีที่แล้ว

    Best explanation on TH-cam for Joins

  • @rahul_mohite_7
    @rahul_mohite_7 ปีที่แล้ว

    you are seriously oms , you are giving knowledge which is not present anywhere over the internet and about concept salute sir 🙋‍♂

  • @pgrana15
    @pgrana15 หลายเดือนก่อน

    I have been so confused regarding when to use which one, this gave me so much clarity. Thank you for this wonderful lecture.

  • @hariniharnath9932
    @hariniharnath9932 ปีที่แล้ว

    Great Explanation. Got Clarity on JOINS. Thank You So much

  • @MUSTAFA91522
    @MUSTAFA91522 26 วันที่ผ่านมา

    Sometimes topics are simple but you need a right guy to deliver it for you in a simple way.
    You got a subscriber ❤

  • @shaliniarya202
    @shaliniarya202 2 หลายเดือนก่อน

    Finally cleared my concept of Joins.
    Thanks

  • @fawadh
    @fawadh 9 หลายเดือนก่อน

    best sql channel, I must say,
    I have failed the interview at noon, I wish i have seen your videos before the interview.

  • @Radhe_kanha0
    @Radhe_kanha0 ปีที่แล้ว

    Best ever video ….and literally now i am clear with this natural join …thank you for sharing.

  • @sujaa1000
    @sujaa1000 4 หลายเดือนก่อน

    That was the best explaination, the formulas and how SQL works internally, thank you so much, please keep up the good work!

  • @myfirstpet6813
    @myfirstpet6813 10 หลายเดือนก่อน +1

    Bro, you are amazing, I would agree to many commenters here, the way you have explained it , joins seem so easy to understand. Do come up with many more awesome videos like this. GLAD WE ALL FOUND YOU!! hooked now sir.. :)

  • @vamsiprince9529
    @vamsiprince9529 ปีที่แล้ว

    Even the one who created sql can't teach better than you about these concepts tq bro

  • @TataNaresh
    @TataNaresh ปีที่แล้ว

    Wow the way Toufiq explains is flawless 🤩

  • @abhishekgowda1776
    @abhishekgowda1776 ปีที่แล้ว +1

    Hi Toufiq. now I clearly understood the join concept, please make video on query analysis and optimization.. I'm learning lot from you brother, keep up the great work 👍 👏

  • @deepthisriram
    @deepthisriram ปีที่แล้ว

    This video cleared all my confusion and very confident now to answer joins based qns. thank you so much

  • @kohilaraghupathi8279
    @kohilaraghupathi8279 ปีที่แล้ว

    Clearly explained exactly 💯 good to watch

  • @tokonboy8093
    @tokonboy8093 ปีที่แล้ว

    Best vdo on TH-cam about joins

  • @nagaprasadreddy5029
    @nagaprasadreddy5029 ปีที่แล้ว

    Most awaited video. Honestly you are a pro in teaching....

  • @ramakrishnapothuraju
    @ramakrishnapothuraju ปีที่แล้ว

    seriously i have seen many videos on joins concept this the best video bro keep it up and THANK YOU

  • @nazman999
    @nazman999 3 หลายเดือนก่อน

    What a fantastic way way to explain. Thank you so much for sharing

  • @jayeshchoudhary6110
    @jayeshchoudhary6110 ปีที่แล้ว

    I randomly find these video and after watching it was nice explanation and explain everything that was good no doubts remaining .Thanks

  • @prasadkudalkar9322
    @prasadkudalkar9322 ปีที่แล้ว

    Your teaching style is superb. Very nicely explained. Thank you so much Taufiq.

  • @piyushshah3975
    @piyushshah3975 2 หลายเดือนก่อน

    Best join videos i saw till date❤ commendable work!!

  • @kiran646
    @kiran646 2 หลายเดือนก่อน

    I got exact idea on how joins are performed. I'm showing you gratitude sincerely. Thank you so much for this kind of explanation💥

  • @Jasmine-zb2zd
    @Jasmine-zb2zd ปีที่แล้ว

    Wow amazing thank you for the explanation I finally understand the way Joins work!!!! I'm super excited and thankful thank you again!!

  • @ajentertainment1584
    @ajentertainment1584 2 หลายเดือนก่อน

    Thank you so much for the explanation, now I got clarity on Joins

  • @krithickg8126
    @krithickg8126 ปีที่แล้ว

    Best video ever made to explain SQL joins in a very simple and subtle way. Thankyou.

  • @aravinds923
    @aravinds923 ปีที่แล้ว

    'techTFQ' My favorite SQL teacher.

  • @henrylokrit232
    @henrylokrit232 ปีที่แล้ว

    The best explanation for SQL joins. Thank you for this video👍🏿

  • @oOcitizenOo
    @oOcitizenOo ปีที่แล้ว

    Thanks for your explanation! Though i work with sql at my current job, watching this was pretty useful

  • @rose9466
    @rose9466 ปีที่แล้ว

    Please keep making videos like these, it is really helpful for interviews

  • @NitinKumar-wk7yz
    @NitinKumar-wk7yz ปีที่แล้ว

    After watching this video i have cleared the join concepts. Thank You So much

  • @AkshayBharadwajN
    @AkshayBharadwajN 10 หลายเดือนก่อน

    Excellent way of explaining joins. Thank you.

  • @suryakanth7337
    @suryakanth7337 ปีที่แล้ว

    Very clear explanation..You are exceptionally good.
    I have a request, please do videos on external tables, Table partition and collections.

  • @manthanmistry1205
    @manthanmistry1205 หลายเดือนก่อน

    Crystal clear explanation. Thanks ❤

  • @nadya6724
    @nadya6724 หลายเดือนก่อน

    I have been looking out for this concept for a long time . Thank you for sharing this video

  • @prakashkoppurapu
    @prakashkoppurapu 10 หลายเดือนก่อน

    Explained very clearly bro 😊
    Till now no one explained like you thank you atlast found a good video

  • @audiobooks993
    @audiobooks993 ปีที่แล้ว

    I have answered 2nd table by pausing the video.and I checked with you I got the results same thank you so much guruji

  • @nowfalriswan
    @nowfalriswan 10 หลายเดือนก่อน

    Crisp and clear explanations!!

  • @rakeshsrking-eu1ff
    @rakeshsrking-eu1ff 10 หลายเดือนก่อน

    Thank you so much for joins video, finally I understand the joins in sql.

  • @user-jk4lp7rv2e
    @user-jk4lp7rv2e 8 หลายเดือนก่อน

    The concept was clearly explained and neat to understand

  • @vinaresh8340
    @vinaresh8340 3 หลายเดือนก่อน +1

    excellent explaination bro, before this video every time confusing on left right joins.

  • @user-ij3wt9cb2h
    @user-ij3wt9cb2h 7 วันที่ผ่านมา

    Bhai, video mast Laga🙏, all concepts are fully cleared. Love you bhai.... Laxmikant T.

  • @toch8528
    @toch8528 10 หลายเดือนก่อน

    just stumbled onto your video.. Siifuuu!! abang, i owe you a good nasi lemak when i visit KL. terima kasih

  • @rohittrimbake-qr8gr
    @rohittrimbake-qr8gr ปีที่แล้ว

    Sir I Love your teaching the way you explained with good understanding English... Thanks

  • @AnalysingDataAnalyzingWorld
    @AnalysingDataAnalyzingWorld 10 หลายเดือนก่อน

    Hats off to you sir
    you are real Guru.

  • @anusharao5202
    @anusharao5202 9 หลายเดือนก่อน

    Beautifully Explained!

  • @kelthekonqrr
    @kelthekonqrr ปีที่แล้ว

    This was super super helpful and interesting ! Thank you so much!

  • @zoon-dot-com
    @zoon-dot-com ปีที่แล้ว

    Amazing! This one video is enough to understand joins.

  • @surabhijagadish5210
    @surabhijagadish5210 2 หลายเดือนก่อน

    Easiest way to understand joins.

  • @fennydobson1378
    @fennydobson1378 10 หลายเดือนก่อน

    thank you so much!! Finally I can say I understand joins!

  • @Adikes_InfoTech
    @Adikes_InfoTech หลายเดือนก่อน

    Hi Sir, till now I had many confusions on Joins concept. But with your explanation my brain understood correctly, and I have created some examples like this, and I have answered the output correctly without writing the code. Thank you so much for clarifying this topic. If we can get this kind of explanations anywhere, I think we can have more coding developers right!!!!🤸‍♀🤸‍♀😎😎

  • @sany2k8
    @sany2k8 ปีที่แล้ว

    The boss of explaining SQL

  • @satyendrayadav4300
    @satyendrayadav4300 9 หลายเดือนก่อน

    Thank you so much Sir for making joins to teach in very simple way

  • @Babayagaom
    @Babayagaom 16 วันที่ผ่านมา

    What an explanation. I was looking for such video. Great💯

  • @vathsalya5807
    @vathsalya5807 2 หลายเดือนก่อน

    Thank you for explaining the join concepts very clearly. Request to post the videos of all the concepts in SQL

  • @bhargaviindla3014
    @bhargaviindla3014 10 หลายเดือนก่อน

    explained in detailed way. Thanks a lot..its very clear