SQL Joins Explained with Examples - Inner Join, Left Join, Right Join, Full Join, Cross & Self Join

Sdílet
Vložit
  • čas přidán 18. 10. 2020
  • #SQL #Joins Explained - If you work with #databases, you need to know what joins are and how to use them. Whether you are new to working with databases, or just need a JOINs refresher, this video is for you.
    In this video, I will explain what joins are, the different types of joins (inner join, outer joins, cross join and self join), and the types of joins needed for certain kinds of questions. I will also answer some common questions (and misconceptions!) about joins.
    In addition to the theory, I will provide you walkthroughs of each type of joins using Microsoft SQL Server (using the Transact-SQL, or T-SQL, variant).
    *CORRECTION: (Thank you Aditya Jain!)
    It looks like I have accidentally copied and pasted the wrong record (sorry!).
    On:
    9:26 - the course that has not been taken yet is COMP4677.
  • Věda a technologie

Komentáře • 52

  • @UprankersCom
    @UprankersCom Před 3 lety +8

    Great content, very good, clear and concise explanation. I am surprised your channel has few subscribers currently, but I am sure it will explode soon, as your other videos, especially the Tableau series, are fantastic as well. Subscribed of course :-).

    • @sqlbelle
      @sqlbelle  Před 3 lety +1

      Thank you so so much for your note, Marcin, very much appreciated. 😀

  • @sqlbelle
    @sqlbelle  Před 3 lety +4

    Learn the basics of combining tables in SQL. This lesson in JOINs will provide you a good foundation as you work with databases. Some myths (or common questions) debunked as well!

  • @yourrecommend525
    @yourrecommend525 Před 2 lety

    initially when i heard channel name i thought it would be sql based videos:-). Still one of the best tableau videos explanation here in the channel. Thanks

  • @gauravtarapure4876
    @gauravtarapure4876 Před 3 lety +1

    I was struggling to understand the join concept having NULL values but this video cleared all my concepts regarding NULL values in joins. Thanks for the awesome content.

    • @sqlbelle
      @sqlbelle  Před 3 lety +2

      Thank you Gaurav for sharing your thoughts! I am happy to hear the video was helpful in clearing up the concepts around NULLs in JOINs! :)

  • @bornkool
    @bornkool Před rokem

    Good video sqlbelle, I see you were using the AdventureWorks database 2017, currently, we are using AdventureWorks 2019. I suppose these databases are very similar in most respects. I appreciate your clear presentation of JOINs. Cheers!

  • @kavitachokshi19
    @kavitachokshi19 Před 3 lety +1

    Excellent explanation!! Very informative. Thank you!

    • @sqlbelle
      @sqlbelle  Před 3 lety

      Thank you for your feedback kavitachokshi19, much appreciated!

  • @kavitachokshi19
    @kavitachokshi19 Před 3 lety +1

    Excellent explanation, Very informative. Definitely will learn a lot from your videos. Thank you.

    • @sqlbelle
      @sqlbelle  Před 3 lety

      Thank you for your feedback kavitachokshi19, much appreciated!

  • @user-yf3dk6gb6s
    @user-yf3dk6gb6s Před 2 měsíci

    Thank you

  • @brightchatawa4002
    @brightchatawa4002 Před rokem

    Wow thank you

  • @nagasantosh472
    @nagasantosh472 Před 3 lety +1

    Thanks for sharing your knowledge, these videos are awesome. Looking out for more tips, Appreciate your hard-work. Great job mam

  • @MrStark-zy6cd
    @MrStark-zy6cd Před 2 lety +1

    I really love your content, i have been searching for good Tableau course for quite a while and even purchased a few courses, but i must say you are the best. i have set a target to watch all of your videos in a few weeks, and apply all the knowledge in my current job, I am confident your content will help me in my career.

  • @peterparker4358
    @peterparker4358 Před 3 lety +1

    Thank you again Mam. nice Video got a real Fan :)

  • @deanodonnell5702
    @deanodonnell5702 Před 10 měsíci

    Hi, it wid be great if you cud tell me what left joins query you ran to get the result. Thanks

  • @Fernando-li4uv
    @Fernando-li4uv Před 3 lety +1

    Brilliant

  • @neelnickkey4865
    @neelnickkey4865 Před 3 lety

    Thanks for your efforts !!!c

  • @vdn5716
    @vdn5716 Před 3 lety +2

    you are best ..

  • @jayasreecarey7843
    @jayasreecarey7843 Před 3 lety +1

    thanks !

    • @sqlbelle
      @sqlbelle  Před 3 lety +1

      Thank you for your feedback and comments in many videos, Jayasree!

  • @tarunpavada427
    @tarunpavada427 Před 3 lety +2

    Hi i guess @10.48 in result table for full outer join the course id with null values should be COMP4677

    • @sqlbelle
      @sqlbelle  Před 3 lety +1

      Hello Tarun, yes you are correct. The correction is posted in the comments section. Unfortunately I cannot simply edit or erase the video. Thank you for your feedback, I appreciate it!

  • @AJaditya123
    @AJaditya123 Před 3 lety +3

    I have been following your videos and doing a binge watch , thanks again for your videos. i may be wrong but at 9.26 , the result of right join looks wrong . The value in the last row should be COMP4677 , Database administration and also at 10.43, the full outer join , should have 5 rows, but video has 7 rows, can you tell me if miss anything?

    • @sqlbelle
      @sqlbelle  Před 3 lety +3

      Hello Aditya,
      Thank you for your comment and the correction! Yes, you are correct! It looks like I incorrectly copied and pasted - I don't think I can correct the video but I will make note in the comment. Thank you so much for this! Very much appreciate the correction.
      Donabel

    • @sqlbelle
      @sqlbelle  Před 3 lety +2

      Thank you again Aditya. I have added the correction note in the description section (and credited you).
      Appreciate your help!

    • @AJaditya123
      @AJaditya123 Před 3 lety +1

      sqlbelle thanks for your videos, can i know , if you have any videos on joins on a one to many , many to many relationship tables, where it usually cause duplicate results and how to avoid those wrong join conditions?

    • @sqlbelle
      @sqlbelle  Před 3 lety +1

      Thank you Aditya. I have one coming up (but this one is specific to Tableau). This one is specific to blend, join and relationships in Tableau, and I talk specifically about the considerations for joins especially the accidental "duplication" of column values. It may still be helpful. It is set to be published later today.
      I also have another video planned on database concepts on subqueries and CTEs. Subqueries/CTEs and temp tables can help in these scenarios if these cannot be addressed at the database schema level.

    • @AJaditya123
      @AJaditya123 Před 3 lety

      @@sqlbelle perfect , looking forward for it. appreciate your time on making them.

  • @woRstbB
    @woRstbB Před 2 lety +1

    9:28 is that the result of right join? Because i can’t see course comp4677 being retained in the result

    • @sqlbelle
      @sqlbelle  Před 2 lety +2

      Thank you Binny! Yes there is a correction in this video that I've provided in the description. Apologies for that!

    • @woRstbB
      @woRstbB Před 2 lety

      @@sqlbelle yes thanks for letting us know. Sorry for not noticing earlier

  • @J58988S
    @J58988S Před 2 lety

    Example at 9:18 just confused me, I would have thought the course IDs on each row should have matched?

    • @sqlbelle
      @sqlbelle  Před 2 lety

      You are correct, there was an error in the slides. I have added this correction in the description.

  • @MrStark-zy6cd
    @MrStark-zy6cd Před 2 lety +1

    10:50 the data in the result doesn't seem correct, it will be great if you can double-check pls or correct me if I misunderstood. Love your content though

    • @sqlbelle
      @sqlbelle  Před 2 lety +1

      Hello - yes, thank you and apologies. You are correct - there is a correction on the video that I added on the description (I noticed only after the video has been uploaded, and YT does not allow replacing the videos for now). Thank you for your kind note. I'll figure out how I can adjust, or possibly just take down the video and upload a slightly updated version.

    • @MrStark-zy6cd
      @MrStark-zy6cd Před 2 lety

      Thank you very much for your reply, I really love your content, i have been searching for good Tableau course for quite a while and even purchased a few courses, but i must say you are the best. i have set a target to watch all of your videos in a few weeks, and apply all the knowledge in my current job, I am confident your content will help me in my career. Have a nice day!!!

  • @uttam8105
    @uttam8105 Před rokem

    I am interested in the concept of reading this message and join me

  • @akhildas3743
    @akhildas3743 Před 3 lety +1

    10:46, 4th row is wrong and not required there and total number of rows should be 5 not 6.

    • @sqlbelle
      @sqlbelle  Před 3 lety

      Thank you. I have noted this correction in the description.

  • @punamsalunkhe8273
    @punamsalunkhe8273 Před rokem +1

    When you are showing result set of right outer join it has mistake. course COMP4677 do not have matching records in left table and it will be preserved in result set. Please correct these mistakes, it confuse new learners

    • @sqlbelle
      @sqlbelle  Před rokem

      Thank you Punam. The correction has been posted in the description since this was first raised. Unfortunately for CZcams there is no easy way to "correct" an existing video, so often times corrections are posted in the text description or as a pinned comment. Appreciate your feedback.

  • @abdelrahmantharwat9506
    @abdelrahmantharwat9506 Před 6 měsíci

    The music is really annoied and made me leave the watching