Learn SQL Joins

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

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

  • @decomplexify
    @decomplexify  ปีที่แล้ว +21

    CONTENTS
    0:00 Introduction
    0:40 INNER JOINs
    9:08 LEFT OUTER JOINs
    13:04 RIGHT OUTER JOINs
    15:36 FULL OUTER JOINs
    17:10 Tailoring the matching criteria
    18:40 CROSS JOINs
    19:24 Joining a table to itself
    21:06 Conclusion

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

      COME BACK

  • @ginadouglas7641
    @ginadouglas7641 ปีที่แล้ว +62

    Thank you so much! You are my favorite TH-cam teacher. Your video on normalization saved me in my first SQL class! So glad to see new content.
    I know these must be incredibly time consuming to make, thank you so much for doing them!

    • @decomplexify
      @decomplexify  ปีที่แล้ว +37

      That's very kind! I'm glad the normalization video was of so much help to you. These videos are pretty time-consuming to make, for sure, but I figure once I finish making a video it's there forever, and I can see from the comments that a lot of people are genuinely being helped by them. Which motivates me to continue making them, albeit slowly!

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

      @@decomplexify The value you provide with these videos is really great!

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

    Such a well prepared explanation 👍. This makes me not to rely on just "pattern recognition" to do database stuff, but has an actual sequence of logical thinking behind it that i finally understand from your videos

  • @sillycoder9690
    @sillycoder9690 ปีที่แล้ว +30

    If I had teachers like you in college, I would become a billionaire by now!

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

      That's a weird analogy ..but ok

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

      @@monikagupta1396 You are weird ..but ok

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

      ​@@monikagupta1396it's a hypothetical, not an analogy

    • @Sub0x-x40
      @Sub0x-x40 10 หลายเดือนก่อน +5

      well you have teachers on youtube like this now, lets get them billions fam!

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

      me only a multimillionaire

  • @b-2699
    @b-2699 ปีที่แล้ว +13

    You have great presentation skills! Thank you so much for what you do. I'm doing a database management course that I've been struggling with and you're normalization video really helped!

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

    Just over 5 minutes in and I am understand so much better. I have done joins before, but wasn't really able to picture it so it made more sense to me. Thank you.

  • @BMG21
    @BMG21 3 หลายเดือนก่อน +2

    Wow, this is absolutely incredible! I gained so much valuable insight from this video, and I truly appreciate the credibility of the information presented. Thank you so much for sharing your knowledge! I also have to mention how pleasant your voice is to listen to-it truly adds an extra layer of enjoyment to the experience!

  • @alexandrafaria2821
    @alexandrafaria2821 11 หลายเดือนก่อน +2

    Thank you so much! I have watched several of your videos now, and they are excellent explanations! I love your animations and your format. I was able to pause the videos, stop and think how I would create the Query, and then continue to see the syntax.
    This has been so helpful. I hope you continue to make new content. I will be eager to see it!

  • @lunaloynaz-lopez2318
    @lunaloynaz-lopez2318 5 หลายเดือนก่อน +1

    I could literally cry you broke it down perfectly. I was hopelessly confused

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

    Loved it! Perfect and concise explaination to a very complex topic

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

    I keep coming back to these videos and learning something new every time!

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

    please continue with this course, you're the best!

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

    I am a total stranger to databases in any professional/formal context, even though I have engaged in what I now (after watching your videos) realize was table normalization a couple of times, e.g. while using Dataview in Obsidian, or Notion.
    After watching this video in particular, it occurred to me that those massive Excel spreadsheets, which some companies base their entire operations on, seem strikingly similar to SQL-based databases with all the JOINs, WHEREs and whatnot.
    But anyway, I wanted to thank you for all the excellent videos with clear explanations, helpful examples and great visuals. Really looking forward for the video(s) about the 4th&5th Normal Forms :)

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

    your videos are really helpful. liked the way you explain the concepts. keep going , looking forward to watch more of your videos.

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

    I was having hard times understanding joins, thanks for this amazing video it helped me grasp the concept better.

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

    definetly my favorite youtube teacher !!

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

    Right the time I was looking for Join videos. I met your videos with database normalisation. I think your methodology works best for me. Keep it up!

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

    Great stuff! This tutorial deserves million views.

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

    Thank you!
    I love the explanation in simple examples
    If I can suggest one topic it would be the one you alluded to in the denormalization video about things we can do for processing layer optimization: sharding, indexes, and statistics

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

    We need more database videos. You explain the concepts so well.

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

    Such a comprehensive video on joins. You are so underrated. Wish you great number of subs. 🤗

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

    these videos are great. please start again...

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

    Please keep it up! You will have a large subscriber base if you do!

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

    Your videos are truly awesome, thank you for making them

  • @je.ro.me_101
    @je.ro.me_101 หลายเดือนก่อน

    Awesome video. Loved it. Fully understood 👏👏

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

    This is top notch quality. Loved it

  • @thorstenl.4928
    @thorstenl.4928 11 หลายเดือนก่อน

    Thanks for the great video (again).
    I have two suggestions.
    - recursive sql requests (e.g. for hierarchies as employee->boss(also an employee)->boss…
    and
    - a join, where I only get one result from the rigt table matched with a condition like min/max/latest (e.g. a gamer joined to (only) the latest purchase he did).
    Maybe these are to small topics, but maybe they can find a place inside a bigger one. These are often situations that seem to be easier, than they actually are.
    Thanks for the good content!

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

    I want to approve my days off maself like Olivia does. Btw the video is lit 🔥

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

    Your videos are great. Can you do some advanced SQL stuff please like procedural function,triggers etc

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

    Amazing - hope you find some free time and pump out more videos cause this stuff rocks!

  • @eswarrupireddy
    @eswarrupireddy 6 หลายเดือนก่อน +2

    Why you stopped doing videos. It is very useful for us. The way of explaining is awesome. Please continue the videos.

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

    thank you for your explanations, they are really great and very helpful. Hope, that you will have a time for new videos. For me will be interesting to see topics like transactions or indexes, or even about executions plans

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

    I didn't know that we can do self-join. thank you!

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

    Thanks for the video, it explains very clearly a difficult concept

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

    Amazing Video! Keep making more on databases!

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

    Just what i needed to learn, Thank you !! !

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

    thank you so much, this is extremely well explained and useful

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

    Pretty clean explanation , thanks for your efforts .

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

    Your videos are wonderful, thank you 💗

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

    Thank you so much for making this content

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

    Love your videos ❤

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

    I liked ur video with both my accounts, so make more of em

  • @user-pi6zk6jq1j
    @user-pi6zk6jq1j 3 หลายเดือนก่อน

    thanks a lot
    you clear out a lot of things : )

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

    Can you start uploading videos again ? I love them

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

    Nice! keep going sir, we need subqueries as well

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

    thanks so much for sharing your wisdom!

  • @HaydenL-uo4ys
    @HaydenL-uo4ys ปีที่แล้ว

    Keep up the good works!

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

    Learned a LOT from all your videos!! If you don't mind, how do you make these videos? What video editing software are you using? I find it super cool and simple. Thank you!

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

      Thanks! I use Videoscribe.

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

    It will be grateful if you can make videos on indexing, partitioning, sharding, cap, etc.

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

    Great video, thanks! Will you make more?

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

    Great video, Thank you. Could you do a video on Subqueries and CTEs (With Clause)

  • @chao-chienchen4393
    @chao-chienchen4393 ปีที่แล้ว

    Wish you had more to come in the near future!!
    Also might seems unrelated but what is the handwritten font you're using? looks amazing!

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

      I'll try and make more videos when I have some free time! Thanks, the font is called Kalam.

    • @chao-chienchen4393
      @chao-chienchen4393 ปีที่แล้ว

      @@decomplexify Much appreciated

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

    Please, explain relationships! 1-N, N-N, etc. Thanks for everthing!

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

    Great video!

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

    Hi,
    Please could you do a video on Star schemas and fact and dimensions tables 🙏

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

    Can you please make video on subnetting?

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

    more please, thank you!

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

    Can you decomplixify object oriented programming and design patterns? Thank you!

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

    thanks a lot for such great explanation, but am just confused a bit on self join , specifically on the ON clause , why not use " ap.Approver_Employee_Number = e.Employee_Number" , why are they not interchangeable?

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

      Glad the video was helpful! Re your question: It's easiest if you imagine that the two copies of the Employee table that we're making use of in this query are literally two different tables.
      One table is called "ap". "ap" is an approver table: every row within the "ap" table represents an approver.
      The other table is called "e". Every row within the "e" table represents an employee.
      Now, to your question 'Why not use "ap.Approver_Employee_Number = e.Employee_Number", the first thing to notice here is that "ap.Approver_Employee_Number" refers to the Approver_Employee_Number on the "ap" table. As mentioned above, every row within the "ap" table represents an approver. So ap.Approver_Employee_Number represents the approver of the approver!
      That's not what we're interested in. We're not interested in the approver of the approver.
      What we're actually interested in is the employee's approver (e.Approver_Employee_Number), which is why e.Approver_Employee_Number is what appears in the join.

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

    Inner join questions: why do you query that way?
    I mean Why do you join and then filter, but not get letter of Hydrogen, then filter it from compound details and then query the data only for rows that you interested in? I mean why you do not use natural for manual search algorithm? Whan downsides of that approach?

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

      An SQL query is just a question that we want the database platform to answer for us. The database platform decides what strategy/algorithms to use internally to come up with the answer - all database platforms have "optimizers" which choose the most efficient strategy/algorithms to use internally to answer a particular query. It's pretty likely that in this case, a query optimizer will use a strategy like what you are suggesting. But just remember: an SQL query doesn't prescribe HOW to answer a question. An SQL query IS the question.

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

      @@decomplexify Oh my God! I just had a revelation thanks to you: query = question. So SQL is actually the a way of how to properly ask questions. How on earth that escaped me...? I have always thought that it was just forging your way to the answer, whereas the system is building that for you, you just ask. Thank you so very much!

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

    ,HI, why you are not uploading any new content anymore? I found your videos very very useful, please keep creating great content, thanks

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

    you are amazing

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

    MORE VIDEOS PLEASE!

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

    in the instruction you were changing the names of tables but not using the "as" is there any special way to do this or just giving the new name at the end of the query?

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

    HUGE thanks❤

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

    what do you use for this handwriting animation please tell me

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

      I use Videoscribe.

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

    Thank you a lot!

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

    More sql topics to be simplified:
    1. Subqueries and its types.
    2. Common Table Expressions
    3. Recursive CTEs
    4. Date-Time Manipulation
    5. Stored Procedures
    6. Windowing Functions
    Please see if you can also help with above topics.

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

    Fantastic

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

    Where did you go?

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

    Decomplexify: we bring simplicity to complex topics
    Also Decomplexify literally 1 second later: suppose we have a database with chemical compounds and their elements ☠️

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

      Yes, I thought the same thing. He could have definitely made the tables much simpler.

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

    we need window function on sql

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

    the last result table is wrong as there is not match for 3 ,4,5 in approver_emp_number so the result should contain only 3 rows where they match please tell i am wrong i am looking at for hour trying to know why

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

      Take each row in the table, look at its Approver Employee Number (call it n), then find a row in the Employee table whose Employee Number is n. That's the matching that this join is doing.

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

      @@decomplexify thanks so much but would I be right if we mixed it to be E.employee = AP.aprovel right

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

      ​@@YoussefAdelZinIf you did that, the query would still return 6 rows, and the headings in the query output would become misleading because "e" is now the approver and "ap" is now a person who gets days off approved by the approver. So the query wouldn't really make sense any more. But it would return 6 rows.

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

      @@decomplexify I understand but it would not contain 2,3,5 it will contain two 1s and three 6s and btw thank you very much for carrying and answering me

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

    Thank you!

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

    Actually it's a great video
    But I have a little comment that regarding data integrity
    You violated it at 20:18
    When you listed the employees table
    You assigned the first row with an approver employee
    Which is not exist while inserting the row
    I hope you got me

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

      Hi Marawan, thanks for your comment. There are many options available for enforcing foreign key constraints. One of them is to enforce the constraints only when everything inside the transaction has completed. So: imagine that the insertion of all those rows occurs in a single transaction, and the constraint checking occurs after all the inserts complete, allowing the transaction to commit.

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

      @@decomplexify i know broo
      But really i love your channel
      You always talk about important stuff
      Can you make a video about CTE
      And ER modeling
      I think it will be great

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

      @@marawanlotfy1477 Thanks! I've been thinking about perhaps doing an ER modelling video at some point.

  • @AbuHuraira-rz3sk
    @AbuHuraira-rz3sk ปีที่แล้ว

    i have some problem in last portion

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

    Thank you

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

    pls come back

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

    i kow that you read comments.. just wanted to know why you stopped. i am a aspiring data analyst. pls help teach it. thanks

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

    Super

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

    SELECT c.compund_name, c.compund_id
    FROM compund c
    JOIN compund_element_detail ced
    USING compound_id --Or (ON c.compund_id = ced.compound_id)
    WHERE ced.element_symbol = 'H'

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

      would this not work? This is what I came up with before the video showed its answer. I guess I don't understand why the 3rd table 'Element' needs to be joined. Trying to get better at thinking through this so any help is appreciated

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

      It's probably because the question asks for "Hydrogen", should work on reading questions fully lol

  • @ThomasJames-w7v
    @ThomasJames-w7v ปีที่แล้ว

    THank you

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

    Great video but your deduction logic in the elemt tables is wrong, you start "knowing" that Hidrogen is represented by the leter H, but you can't asume this, you should do the folowing: Look at the element table and check what element symbol represent the hidrogen and the go to compound element detail to check element symbol vs compound id and with that go to the compound table

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

    I hope it's not the last video

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

    Just wow

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

    MAKE MORE VIDEOS

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

    why did u stop uploading?

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

      Haven't had time to make videos lately, but I will resume at some point.

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

    BRO WTF HOW YOU GET 40K SUBSCRIBERS ON JUST 7 VIDEOS MY MAN

  • @Coctvdt
    @Coctvdt 25 วันที่ผ่านมา

    omfg i hate chemistry

  • @ЕдвардГригорян-н6к
    @ЕдвардГригорян-н6к ปีที่แล้ว +2

    dude, you really overcomplicated this topic...

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

      He did so by using chemical compounds and their elements as table examples.