SQL Subquery | Complete Guide with Correlated Subquery |

Поділитися
Вставка
  • Опубліковано 28 січ 2025

КОМЕНТАРІ • 139

  • @DataWithBaraa
    @DataWithBaraa  4 місяці тому +10

    If you want to see more videos like this, Subscribe for more data tutorials like this :) bit.ly/3GiCVUE
    TIMESTAMPS
    ---------------------------------
    00:00 Intro
    00:26 What is Subquery?
    03:40 Why Subquery?
    05:45 Categories of Subquery
    07:52 Subquery Result Types
    10:23 FROM Clause Subquery
    21:15 How DB Executes Subquery
    22:51 SELECT Clause Subquery
    29:54 JOIN Clause Subquery
    34:57 WHERE Clause Subquery
    41:41 IN Operator Subquery
    50:11 ANY, ALL Operators Subquery
    56:25 Correlated Vs Non-Correlated Subqueries
    01:07:11 Exists Operator Subquery
    01:19:11 Subquery Summary
    Enjoy

  • @habibpranav
    @habibpranav 2 місяці тому +8

    Nobody on the internet has explained this topic in such a concise and clear way but you did and thank you for that Baraa.

  • @yashkamath9969
    @yashkamath9969 Місяць тому +3

    Subqueries was the topic where i used to get confused about where and when to use . You explained each of the cases properly . Thank You

  • @surajjidge970
    @surajjidge970 4 місяці тому +6

    One of the best channel on UA-cam to learn SQL..!

  • @adityamulay1342
    @adityamulay1342 20 годин тому

    Thanks a lot, Baraa! I was struggling with subqueries and watched almost all the available videos on this topic on UA-cam, but I didn’t understand a word. However, after watching your entire video, I can finally say that I’ve understood this topic clearly! Thanks again, and wishing you the best!

  • @gbadeboabayomi9241
    @gbadeboabayomi9241 4 місяці тому +24

    Hey folks! Please subscribe to his channel. It's the only way to appreciate Baraa's selfless service to humanity. Thank you all for doing just that!

    • @Sjjeien
      @Sjjeien 4 місяці тому +1

      Why??
      We cant even understand his language due to that accent. So better search other vedios

    • @farukhahmad1561
      @farukhahmad1561 4 місяці тому

      I have subscribed him. He is great and puts a lot of efforts in his videos.

    • @Toyahan43
      @Toyahan43 3 місяці тому +1

      ​@@SjjeienI couldn't understand at first too but you will get used to it. His teaching style is one of a kind, you will not find another person putting so much effort into his videos and making it avaliable to others for free. What dedication!

    • @Sjjeien
      @Sjjeien 3 місяці тому

      @@Toyahan43 thats not the case. There are lot of free videos available in youtube. But i cant even understand what this guy is saying...
      And also there is no need to watch till the language is used to me. As there are lot more easily understandable youtubers are present
      Then i thought that, instead of spending time watching this video. I should look for another

    • @Toyahan43
      @Toyahan43 3 місяці тому

      @@Sjjeien sure, whatever works for you. I have watched other youtubers but their lessons aren't as comprehensive. If they work for you then great

  • @DivyYadav-hg2js
    @DivyYadav-hg2js 3 місяці тому +4

    FOR NOW THIS CHANNEL IS THE BEST CHANNEL TO LEARN SQL AND TABLEAU, I HOPE BARA U GET PYTHON AND POWER BI SOON I CAN SEE THIS CHANNEL REACHING HEIGHTS IN THE UPCOMING YEARS AS THE AMOUNT OF EFFORTS U PUT IN WILL SURELY MAKE THIS CHANNEL THE TOP CHANNEL FOR DATA ON UA-cam. THANK YOU FOR UR EFFORTS

  • @veerendram6638
    @veerendram6638 4 місяці тому +6

    Sir i am big fan of your teaching
    Excellent work 👏👏👏

  • @Humanity_matters_1st
    @Humanity_matters_1st 4 місяці тому +2

    I really enjoyed this lesson! The way you broke down the complex topic into smaller, manageable sections made it much easier to understand. I look forward to more like this in the future. Keep up the great work! :-)

  • @ahmedshalaby9343
    @ahmedshalaby9343 2 місяці тому +3

    just wanted to thank you because of your videos I have passed the interview

  • @s77lom49
    @s77lom49 4 місяці тому +2

    Subscribed.
    You are truely the best. I've been watching your advanced SQL course and it's been really helpful to me. Thank you.
    Highly recommended watch to anyone wanting to better their understanding of advanced SQL functions !!

  • @DivyYadav-hg2js
    @DivyYadav-hg2js 3 місяці тому +6

    highest quality video on subquey ever made

  • @hafsaaittaleb6178
    @hafsaaittaleb6178 4 місяці тому +3

    Awesome! the best UA-cam channel EVER , I'm on the 13 hour in tableau Tutorial and it' just amazing Baraa, Please we need PYTHON asap. You must teach our teachers at university because we don't understand anything from them.

  • @DivyYadav-hg2js
    @DivyYadav-hg2js 3 місяці тому +5

    YESTERDAY MY FRIEND CALLED ME AND THANKED ME FOR SUGGESTING UR CHANNEL TO HIM, UR A LIFE SAVER BARA U GOT COVERD SQL AND TABLEAU . tbh im ready to pay u for ur course on python and the amount of efforts u put are amazing please start python in ur way ur a DATA GOD u dont even know u helped so many people THANK U

  • @ImtiyazMohammed-mp8mp
    @ImtiyazMohammed-mp8mp 2 місяці тому +1

    This is amazing, I learned basic sql from w3schools and some videos but wasn't able to proceed further then came across your channel. Thank you.

  • @poojabihani-m9d
    @poojabihani-m9d 4 місяці тому

    Thank youuu so much!!!
    Only 20 minutes into the course and I'm learning alot of stuff, which i didn't learned in paid courses
    Thank you soo much!!!
    Please never stop uploading videoss

  • @priyaljain8797
    @priyaljain8797 4 місяці тому +2

    Love love love for making sql so interesting with your teaching style!!

  • @RajdeepKumar-i5l
    @RajdeepKumar-i5l 4 місяці тому +3

    Thank you Baraa, Completing this tutorial with practice, revision and notes making.

  • @SAhmBal89
    @SAhmBal89 2 місяці тому +2

    It's clear and simplest way to make us understand complex queries, but not only writing queries, but also clearly explaining our concepts about how SQL works behind the scenes. The presentation is also amazing and engaging, which doesn't make us feel bored. Overall, amazing content, highly appreciated! Thanks to the UA-cam algorithm for bringing me here.

    • @DataWithBaraa
      @DataWithBaraa  Місяць тому +1

      Thank you so much for the kind words! I’m thrilled you’re enjoying the content and finding it engaging. Glad the algorithm brought you here! 😊

  • @RikhaMida
    @RikhaMida 2 місяці тому +1

    Your channel is magnificent, it really helps many people especially beginner to be a master in SQL. Great job!

  • @AmanSingh-go2gf
    @AmanSingh-go2gf 4 місяці тому +2

    I think the only channel which inspired me to learn SQL and tableau from scratch .. from a dot to a line .
    I must say the only channel which make your concepts crystal clear in tableau .....❤

  • @NidhiGusai
    @NidhiGusai 4 місяці тому +2

    sir, you are doing great work. With your tutorials, I can now solve any SQL problems. Thank you for creating interactive and easily understandable SQL tutorials.

  • @NohablaEspnaol
    @NohablaEspnaol Місяць тому +1

    Thank you so much sir, you have explained it really well, loved your teaching method

  • @mkind05
    @mkind05 15 днів тому +1

    a correlated Subquery is like a magic 🪄
    Thank you Baraa for your explanation of this hard topic!!!

  • @satyar-g5p
    @satyar-g5p 3 місяці тому +2

    cool video, really good tutorial, explained well, audio and visuals are perfect, will check out more of your videos. 😀

  • @hermanmokgope3011
    @hermanmokgope3011 4 місяці тому +2

    I've been waiting bro, came at a right time. 🎉

  • @gsalema9607
    @gsalema9607 4 місяці тому +5

    Here we go again, this channel is all about uplifting yourself to the world 🎉

  • @vasilkagenova6266
    @vasilkagenova6266 3 місяці тому +1

    Thank you so much. You are amazing. Whit, your calm voice and comprehensive explanation make the material easier to understand.

  • @SC-mx4wp
    @SC-mx4wp 4 місяці тому +3

    BEST EVER TEACHER I MATE IN MY LIFE 🎉🎉❤❤. KEEP IT UP SIR.
    PLEASE HAVE FULL TOPICS COVERED ON SQL, TABLEAU, POWER BI 🎉🎉🎉

  • @EsraaAyman-t3o
    @EsraaAyman-t3o 4 місяці тому

    I have watched so many tutors but the way you explain the information is really interesting and it's not that you share info you explain why it's happening and this is respectful thanks for your efforts.

  • @TheDataworm
    @TheDataworm 3 місяці тому +1

    You have an awesome tutorial libray on SQL the only addition I would recommend is making a long tutorial solving complex problems using all the skills you have taught. it will be very valuable to see the thought process of solving harder problems and choosing the right approaches.

    • @DataWithBaraa
      @DataWithBaraa  3 місяці тому

      Great suggestion!

    • @TheDataworm
      @TheDataworm 3 місяці тому +1

      @@DataWithBaraa Since you liked my suggestion 😉, I’d also recommend combining the advanced SQL playlist into one long video-it’ll definitely get more views like your basic SQL video! There are very few quality advanced SQL tutorials on UA-cam. Also, do one on "pivot table"

  • @ska5691
    @ska5691 2 місяці тому +1

    Thank you, Baraa Today I have learnt the concept of subqueries properly

  • @deepam.g4558
    @deepam.g4558 Місяць тому +1

    Iconic Explanation ❤

  • @donyelldf
    @donyelldf 4 місяці тому +2

    Another great video, you are a true teacher. Thank you

  • @Naveed-u1s
    @Naveed-u1s День тому +1

    Wonderful Baraaaaaaa 👍

  • @7to7media
    @7to7media Місяць тому +1

    Thanks 🎉

  • @juancruz7836
    @juancruz7836 4 місяці тому +2

    I was waiting for this video, thanks :D:D:D

  • @pyephetsavanh6668
    @pyephetsavanh6668 3 місяці тому +1

    Thank you for your kindness sharing your knowledge ❤❤❤❤❤

  • @pxlmusicby
    @pxlmusicby 4 місяці тому +3

    Never seen a person who can simplify things this easy

  • @alexshat4715
    @alexshat4715 Місяць тому

    Baraa, thank you for your knowledge and quality work, this is the best course on SQL!

  • @OrtikAbdakimov
    @OrtikAbdakimov 4 місяці тому +1

    Hurrraaaa🎉🎉🎉🎉❤❤❤❤ i was waiting for it

  • @ashokmulimani9598
    @ashokmulimani9598 4 місяці тому +2

    I am really waited for this video.. thanks

  • @harsh07g-h3m
    @harsh07g-h3m Місяць тому +1

    Awesome sir ❤❤

  • @felipeabreumotta7651
    @felipeabreumotta7651 День тому +1

    Great content, Thank you!

  • @AnyBenny
    @AnyBenny 4 місяці тому +1

    The best explanation!

  • @Abzarad
    @Abzarad 4 місяці тому +1

    بارك الله فيك

  • @shahbazfareedchishti
    @shahbazfareedchishti 12 днів тому +1

    Keep making such informative videos Baraa

  • @mahmoudalsayyad90
    @mahmoudalsayyad90 3 місяці тому +1

    I can't thank you enough! Could you please continue the course with advanced topics in databases, such as indexing, transactions, storage, and so on?

  • @rajeshrana6481
    @rajeshrana6481 17 днів тому +1

    like always great knowledge ...

  • @ManjeeriG
    @ManjeeriG 4 місяці тому +1

    Thank you Baraa..😊

  • @HadeerMansha
    @HadeerMansha 2 місяці тому +1

    Thanks sir for such a valuable content❤❤

  • @chaparlapradeepchowdary3156
    @chaparlapradeepchowdary3156 День тому +1

    Good explanation

  • @govardhanreddy690
    @govardhanreddy690 3 місяці тому +1

    Thank you sir ❤

  • @martinberger365
    @martinberger365 4 місяці тому +2

    Love your tutorials @baraa, you are the best teacher ever!
    BTW I guess that using CTE, sometimes JOINS or Self joins, temporary tables, etc it's much useful than subqueries. For my experiences subqueries are not very much appreciated.

  • @jbjsb
    @jbjsb 4 місяці тому +1

    Always on top ❤👌

  • @utkarshgupta-q5c
    @utkarshgupta-q5c 4 місяці тому +2

    Baraa brother , can you please provide the estimated time line for covering all the topics in advance sql. your videos are so awesome and easy to understand each concept with clarity. eagerly waiting for rest of the parts.

    • @DataWithBaraa
      @DataWithBaraa  4 місяці тому

      I hope in October I would cover the whole course, working now on sql projects. Good quality needs time

    • @utkarshgupta-q5c
      @utkarshgupta-q5c 4 місяці тому

      @@DataWithBaraa Thanks Baraa for the quick response. Yes it does take time to make quality content. Will be waiting for the new videos.

  • @mochamadsyahrizal
    @mochamadsyahrizal 4 місяці тому +3

    Yeaaahhh SQL Subquery letsgooo!!

  • @DivyYadav-hg2js
    @DivyYadav-hg2js 3 місяці тому +2

    BARA IF U GET A PYTHON COURSE FOR DATA SCIENCE IM SURE THIS CHANNEL WILL BE THE MOST POULAR CHANNEL ON UA-cam WAITING FOR UR NEW COURSE LOVE YOU

  • @mohamed0707-g7n
    @mohamed0707-g7n 4 місяці тому +1

    Thank you so much ❤

  • @ahmedshalaby9343
    @ahmedshalaby9343 2 місяці тому +1

    we need another video difference between joins and subqueries and related to the performance

  • @ehabnady2473
    @ehabnady2473 4 місяці тому

    Great video as always Barra

  • @farukhahmad1561
    @farukhahmad1561 4 місяці тому +2

    Hey Baraa, I really enjoy your videos.
    Can you please make a Tutorial Video on power BI?

  • @sajibislam3281
    @sajibislam3281 Місяць тому

    Thank you once again Bara...

  • @makarsh29
    @makarsh29 4 місяці тому +3

    please make video on recursive cte

  • @subashlingden9883
    @subashlingden9883 4 місяці тому

    Thank you Baraa!

  • @maskanist
    @maskanist 3 місяці тому +1

    Hello @DatawithBara!
    Hope you are doing well and really thank you so much for this amazing package and I learned a lot from you rather than my own teacher.
    Appreciating your good effort, would you please make a video on CASE STATEMENT similar to subquery full video you made already?
    Kindly help me in this regard and make a full package video on CASE STATEMENT & CASE STATEMENT with JOINS but complete one, similar to SUBQUERY CHAPTER you made.
    Thanks.... I will be looking forward your kind feedback. Love you ❤❤❤❤❤❤

  • @PhaswanaLedwaba
    @PhaswanaLedwaba 4 місяці тому

    Nobody does SQL like Baraaaa! 🎉

  • @kelothkanna
    @kelothkanna 2 місяці тому +1

    so informative sir..a request from your student can you please make videos on python for data analytics

  • @shrutiy903
    @shrutiy903 4 місяці тому +2

    Hi...
    Will you pls make one complete playlist for data analyst...
    Thank u in advance

  • @abhishekkukreja6735
    @abhishekkukreja6735 4 місяці тому +2

    How do you edit videos and add animation? Its amazing

  • @ragulmarley4900
    @ragulmarley4900 4 місяці тому +2

    😊new subscriber add some videos beginner to pro sql for data analytics concept 😊 ... Kudos for ur efforts

  • @Aky-n4j
    @Aky-n4j 4 місяці тому +6

    There is one more video left. After that CTE will come for which I am waiting.

    • @ManjeeriG
      @ManjeeriG 4 місяці тому

      Yes. Me too 😊

  • @huseyinbarkay5854
    @huseyinbarkay5854 4 місяці тому

    I was having hard times with subqueries, well this guy came second to Jesus
    Ty so much man !

  • @kiminonashidesu8697
    @kiminonashidesu8697 4 місяці тому +2

    Hi Baraa! How many clips do you want to do tutorial? Thanks to make me understand sql better.

  • @A4O_TSL
    @A4O_TSL 4 місяці тому +1

    Baraa, I'm from Argentina and I commited myself in this journey to be a Data Analyst and a System Enginner because i love this world of the data, and I meet your channel with the HR tableau proyect, and i want to say you, thank you for all that you do for us, you may one of the best inspirations that i have to dont cross my arms and say i can be a data analyst. Greetings from Argentina

    • @martinberger365
      @martinberger365 4 місяці тому

      ¿Y como te fue? Porque veo que hace tres años arrancaste a estudiar. ¿Ya estas metido en el mundo del data?

    • @A4O_TSL
      @A4O_TSL 4 місяці тому

      @@martinberger365 Hola!, si en realidad hace casi 2 mejor dicho finales del 2022 empecé con pequeños tumbos por temas de tiempo, y el año pasado fue donde más le di fuerza a esto, a pesar de que aún suelo hacer algunos que otro proyecto me dedicó a la parte BI de una empresa donde vivo, siendo el encargado de la parte analítica y de negocios, y además sumado a que estoy en mí 4to año de carrera casi 5to, es difícil...mucho, pero se puede, siempre adelante sigue, es mí mejor consejo, desde los proyectos básicos y tontos hasta los que tu conocimiento avanzado llegue, no hay que hacer mucho a veces y otras hay demasiado, pero esto es asi. Saludos

    • @martinberger365
      @martinberger365 4 місяці тому

      @@A4O_TSL cuánto me alegro.
      Bueno me encantaría poder hablar con vos porque quiero hacer el mismo camino. Hace un año que estudio e hice cuatro proyectos en Github

  • @musicloverr547
    @musicloverr547 Місяць тому +1

    ❤from india❤

  • @Ajpraize7
    @Ajpraize7 2 місяці тому +1

    Can you please add the dataset you use along with your videos so we can practice and try along with it. thanks

    • @DataWithBaraa
      @DataWithBaraa  2 місяці тому

      It is already available check the substack the link in my description

  • @Bengisu-dmr
    @Bengisu-dmr Місяць тому +1

    you are absolutely the best teacher ! but why did you edit the nescafe mug as if there is hot drink in it. Lol

  • @DivyYadav-hg2js
    @DivyYadav-hg2js 3 місяці тому +2

    CAN U ALSO COVER A TOPIC CALLED INDEXING AND TRIGGERS IN SQL ITLL MAKE IT COMPLETE THANK U THOUGH BARA

  • @adwaitjawadekar1185
    @adwaitjawadekar1185 4 місяці тому +2

    Sir can you please make 1 video For subquery CTE its a highly asked interview questions.

  • @adesholaolaitan2257
    @adesholaolaitan2257 6 днів тому +1

    Please which screen recording software do you use?

  • @Toyahan43
    @Toyahan43 3 місяці тому +1

    Brother, please provide the presentation notes for the lectures. It will be really helpful

  • @Bengisu-dmr
    @Bengisu-dmr 26 днів тому

    1:13:00 For exists subquery, select 1 sounds like "return True". I am curious whether SELECT 0, returns true or false. Because it will return a value but 0 usually means "false". I am gonna give it a try and comment.

    • @Bengisu-dmr
      @Bengisu-dmr 26 днів тому

      SELECT 0 DOES the exactly same thing what SELECT 1 does. It is interesting to me that the thinking process of sql that is so different than programming languages like python or C. It requires another way of thinking

  • @aabhasagrawal410
    @aabhasagrawal410 4 місяці тому +1

    sir can you suggest where can i practice sql questions to improve my understanding. Any set of questions

    • @DataWithBaraa
      @DataWithBaraa  4 місяці тому

      @@aabhasagrawal410 I suggest to interact with ChatGPT to practice and generate practice examples

    • @aabhasagrawal410
      @aabhasagrawal410 4 місяці тому

      @@DataWithBaraa it will be very unstructured sir, i tried leetcode and all but the quality of questions is not at par there.

    • @nothuman8989
      @nothuman8989 4 місяці тому +1

      @@aabhasagrawal410 For , leetcode there are many other concepts left to learn , Best go to chat gpt any write a query there , I have learned sql subqueries and now i want to pratice it , give me 20 question that are most frequently asked in sql interview questions , that are realted to sql sub queries . Modify query according to your need .

    • @aabhasagrawal410
      @aabhasagrawal410 4 місяці тому

      @@nothuman8989 oh thanks sir.

  • @durgabudhathoki
    @durgabudhathoki 4 місяці тому +1

    Finally !!video is out.. waiting is over 🎉❤

  • @LeonanielBalijon
    @LeonanielBalijon 3 місяці тому

    where can i find the dataset for this? so that I can practice... thank you

  • @kalyanichoudhari5348
    @kalyanichoudhari5348 Місяць тому

    Hey Bara , which dataset you've used . can I get a lik of that.

  • @OPTIMUSPRIME-q8x
    @OPTIMUSPRIME-q8x 4 місяці тому +1

    time to sit and learn again 😅😅

    • @DataWithBaraa
      @DataWithBaraa  4 місяці тому

      @@OPTIMUSPRIME-q8x you always make me laugh with this comment 😂😂

  • @DGTransformer
    @DGTransformer 4 місяці тому

    Hello Baraa, in tableau i want to link a dashboard with another external one.

  • @odursun
    @odursun 15 днів тому

    Is it possible to get the same result without applying the subquery?
    SELECT PoductID, Price
    FROM Sales.Products
    WHERE Price > AVG(Price)
    As price and the calculated average price are information within the same table.

  • @NGKannur
    @NGKannur 4 місяці тому +2

    My another morning stuff. completed in one sit. Thanks Baraa💥💜
    Whoever reading my comment, Please ensure subscribe the channel and support Baraa. Its just a matter of clicking a subscribe button there for we support motivate this person. I forwarded this to my fellow friends and colleagues and every ones liked the way he explain the topics. From Kerala, India

  • @upshow781
    @upshow781 3 місяці тому +1

    If there was a way for me to like and subscribe 1000 time in your channel I will gladly do so. Dude, ur the best

    • @DataWithBaraa
      @DataWithBaraa  3 місяці тому

      Wow so nice of you thanks dear ❤️

  • @rajshekar1362
    @rajshekar1362 4 місяці тому +1

    I'm really waiting for this video thank you Baraa 🎉❤

  • @Freewiseman
    @Freewiseman 5 днів тому +1

    Will be looking for your Tableau too. Thanks ,we are waiting for your Python lesson Baraa.

  • @Freewiseman
    @Freewiseman 5 днів тому +1

    Please guys, if you wanna learn real raw SQL subscribe to this guy tutorial, he is indeed SQL Wizard , He actual architecturised the structure of the said SQL. This training is marvellous. Thank you Baraa