Recursive SQL Queries Tutorial | Learn to write SQL Queries using Recursion

  Рет қаралды 229,388

techTFQ

techTFQ

Күн бұрын

Пікірлер: 326
@techTFQ
@techTFQ 2 жыл бұрын
Visit brilliant.org/techTFQ/ to get started learning STEM for free, and the first 200 people will get 20% off their annual premium subscription.
@singavarapunavya9143
@singavarapunavya9143 2 жыл бұрын
Hi @techTFQ I have been following you since very long time and I got better in SQL just because of you! Thanks a lot. Now I have a problem and not able to solve it since 2 days! Could you please help me with it! SELECT * FROM YourTable WHERE '123' IN ('Col1', 'Col2','Col3'...'Coln') But the Where condition isn't working for 2 values example: WHERE ('123', '456') IN ('Col1', 'Col2','Col3'...'Coln') , Is there any way to search for 2 or more values existing in different columns??
@techTFQ
@techTFQ 2 жыл бұрын
Thank you Navya .. You can use OR clause for this case.. WHERE ( Col1 in (123, 456) OR Col2 in (123, 456) OR Col3 in (123, 456) OR Col4 in (123, 456) )
@singavarapunavya9143
@singavarapunavya9143 2 жыл бұрын
@@techTFQ Thanks for the response, Yes I did use it but I don't want to write multiple OR's because 123, 456 is not constant and these might go upto 100 or 200, so I have to paste them in every single OR condition every time! So is there any way to solve this issue? I want to give the values only once and it should check in all the columns for it's existence.
@techTFQ
@techTFQ 2 жыл бұрын
Can you share the entire query and datasets with me so I can check . U can email me
@singavarapunavya9143
@singavarapunavya9143 2 жыл бұрын
@@techTFQ sure thanks.
@correialc
@correialc 2 жыл бұрын
Hi Thoufiq. I've been working with SQL (and teaching) for more than 2 decades and never found someone addressing SQL problems like you. The strongest aspects are problem-solving orientation (instead of theoretical) and ANSI standard queries (as much as possible). Congratulations! I'm recommending your videos to my students and workmates.
@techTFQ
@techTFQ 2 жыл бұрын
Hi Leandro, Thank you so much 🙏🏼 It’s very special to receive such amazing feedback from an experienced SQL professional like yourself. Thank you for sharing this feedback, means a lot 🙏🏼 And thank you too for recommending my contents..
@MimmoCRISTOFARO
@MimmoCRISTOFARO 9 ай бұрын
At last a clear, detailed and impressive explanation with real examples of what is, how it works and how to write a WITH RECURSIVE CTE. BRAVO!!!
@sspinjari
@sspinjari 2 жыл бұрын
Every single person who is working in SQL must have this channel in youtube subscribe list. I have recommended this channel to 3 colleague's & I am extremely happy to say they all liked this channel. And all 3 are thanking me 😍
@DinoDunelm
@DinoDunelm 9 ай бұрын
Thank you so much for the detailed tutorial! I’ve been a data analyst for three years but never came across this technique until I received an interview from another company. Hope I can ace that SQL interview🤞
@mike-w1t2e
@mike-w1t2e 11 ай бұрын
I've looked at dozens of RECURSIVE CTE tutorials but until this one, I couldn't find an explanation of the JOIN condition. Thank you ... exactly what I needed!
@aakriti_100
@aakriti_100 2 жыл бұрын
I did both these topics (CTE & recursive CTE) from LinkedIn learning; they made me feel like I can't learn but you make SQL so easy. Thanks for your content:-) I'm at my first step as data analyst; looking forward to have help from you.
@techTFQ
@techTFQ 2 жыл бұрын
I am glad to hear that Aakriti
@claybyfrancisshop
@claybyfrancisshop Жыл бұрын
I've started my data science course and I thought that recursive cte wasn't meant for me but thanks to you i'm finally able to understand the logic behind it. Thanks Thoufiq.
@techTFQ
@techTFQ Жыл бұрын
Thanks, glad it helped
@karthikeyanpandian1330
@karthikeyanpandian1330 2 жыл бұрын
Hey Thoufiq, I have become a big fan of your content off late. I think that I have subscribed and started watching your videos for a month or 2. However, I have completed watching every single video that you have uploaded so far. The way of teaching is excellent and the examples that you provide are the backbone for the concepts that you are explaining. Great work! Thanks for the amazing knowledge share!
@techTFQ
@techTFQ 2 жыл бұрын
Thank you so very much Karthikeyan :) I am so glad you have liked my contents. Thanks for the feedback too
@sangnguyet2011
@sangnguyet2011 10 ай бұрын
Thanks!
@theshanerap
@theshanerap 2 жыл бұрын
You’ve taught me more in one week, than I learnt in one semester. GOAT STUFF!
@sachinvishwakarma5868
@sachinvishwakarma5868 2 жыл бұрын
Very well explained. I remember using the same concept when I had to generate the Voucher Code for one promotion feature. The voucher code should be AlphaNumeric and it should not already be present in the existing VoucherCodes table. It was very interesting and this concept had helped a lot.
@dhirendratripathi891
@dhirendratripathi891 2 жыл бұрын
Literally I would say god level explanation, I was struggling with recursive query recently i had use case 👍
@sujaa1000
@sujaa1000 11 ай бұрын
Hi @techTFQ, I wanted to express my sincere gratitude for the invaluable knowledge I've gained through your videos. As an experienced data engineer, I have found your content to be exceptionally insightful and well-presented. Your selfless efforts and dedication to teaching have not gone unnoticed, and I truly appreciate the time you invest in sharing your expertise. The clarity with which you explain complex concepts and the practical insights you provide on data analysis have been immensely beneficial to my learning journey. Your commitment to excellence in education is evident, and I wanted to take a moment to acknowledge and thank you for the positive impact you've had on my understanding of the subject. I have enthusiastically recommended your channel to many of my colleagues who, like me, greatly appreciate the quality of your content. Please continue your outstanding work, as it is making a significant difference in the learning experiences of individuals in the data engineering community. Thank you once again for your dedication and exceptional teaching. Regards
@cbarlow3
@cbarlow3 Жыл бұрын
Excellent explanation, Thofique! I like how when you ran the second example in multiple DBMSs, you went in an order that made you do an ever-increasing number of changes. :) I'll add another layer: if you were using Db2, you would have to 1. remove the RECURSIVE keywork, 2. use UNION ALL instead of UNION (I generally discourage using UNION by itself anyway), 3. specify column aliases as part of your CTE syntax (so far all the same changes you need for Oracle)...AND you also can't do an INNER JOIN in your recursive CTE! Not a problem for Example 1 (output integers 1 through 10), but for Example 2 it means you would have to go back in time to a time before INNER JOIN was invented (pre-1992!) and change your (INNER) JOIN to a Cartesian join (using the old-school comma-separated list of tablenames...not even the CROSS JOIN syntax!) followed by the appropriate WHERE clause to ensure you only get back the same rows that you would have with an INNER JOIN. Weird, right?
@Rockythepom
@Rockythepom Жыл бұрын
A detailed explanation of confusing recursive query. simply Awsome
@santoshgowda7462
@santoshgowda7462 2 жыл бұрын
I have watched so many videos regarding the same topic but really you made me understand very easily...thank you very much. keep teaching us.
@techTFQ
@techTFQ 2 жыл бұрын
Glad to hear that Santhosh ☺️
@SoumyaPriyaGodera
@SoumyaPriyaGodera Жыл бұрын
Hi Thoufiq,I am a beginner learning Data Science course. Your teaching skills are very good and anyone can understand the way you explain. I really thank you for the SQL videos which are very useful and also I recommend to my friends to watch your videos.
@anushas1910
@anushas1910 6 ай бұрын
Your Amazing sir . Even a person with Zero Sql knowledge can easily understand the concept .Thank you for your efforts to make us to understand the concept :-)
@tuandino6990
@tuandino6990 2 жыл бұрын
Finally a video that can help me understand recursive sql query. Salute to you sir
@techTFQ
@techTFQ 2 жыл бұрын
Glad this helped
@Dental798
@Dental798 2 жыл бұрын
Fantastic in my 10 years of IT i have not seen this in-depth tutorial. Amazing ✋
@timothymalahy7880
@timothymalahy7880 2 жыл бұрын
Definitely one of the better examples and succinct explanations. I liked how you reviewed the syntax first and came back to it when implementing. Keep it up.
@sonalilagnajita8740
@sonalilagnajita8740 2 жыл бұрын
Hey @techTFQ, i have been struggling with recursive query from long time. You gave me a crystal clear understanding. Thanks
@dmitrii4799
@dmitrii4799 2 жыл бұрын
Great explanation. How to show the hierarchy up and additionally if a manager has another employee, besides the searched one, show him and hierarchy down, if searching down found employee has 2nd manager then show him too. So we show all hierarchy of the company.
@towhidulrazu
@towhidulrazu 6 ай бұрын
Your SQL videos are awesome & extraordinarily understoodable. Seems like taking a delicious chocolate everytime. Once again another SQL (recursive this time) is now clear like distilled water! Hats off bro!
@sql8758
@sql8758 2 жыл бұрын
Thank you so much for the video Taufiq. When I'm struggling to SQL problems, your videos are my first to go.
@techTFQ
@techTFQ 2 жыл бұрын
I am glad to hear that bro
@Anonymous_it_is
@Anonymous_it_is Жыл бұрын
You explain complex topics in a very intuitive manner. Awesome content!! I was having a hard time understanding recursive CTEs, but after watching this - everything seems crystal clear about recursive CTEs :)
@foryoutube2563
@foryoutube2563 3 ай бұрын
Thanks
@SwethaNandyala-sf9lt
@SwethaNandyala-sf9lt Жыл бұрын
Cant thank you enough for your content and explaination....lots of admiration from banaglore
@kinjalbrahmbhatt6410
@kinjalbrahmbhatt6410 8 ай бұрын
Hi toufiq, i have been go through many sql videos but your videos are very descriptive i love the way you elaborate small small details while solving queries,it would be great if you help out what is going on in industrial work Love from india
@fenggao3170
@fenggao3170 2 жыл бұрын
This is definitely an amazing lesson helping me to resolve the issues in my work. Thanks Thoufiq, you are an amazing tutor.
@odelolatechup1447
@odelolatechup1447 2 жыл бұрын
You are great I must be plain...more grace to your elbow... I am your big fan 🤗
@techTFQ
@techTFQ 2 жыл бұрын
Thank you so much bro 😀 Appreciate your support
@siddheshaddarkar4074
@siddheshaddarkar4074 7 ай бұрын
Thanks a lot... CTE is great...we can further optimise by creating cte_employee to store employees _details in single time...and use the same cte in recursive
@krishna6296
@krishna6296 2 жыл бұрын
Awesome! Thank you and keep posting more SQL tutorials.
@techTFQ
@techTFQ 2 жыл бұрын
Your welcome buddy and will do
@a-ezzat5677
@a-ezzat5677 10 ай бұрын
i really respect you so much you are a professional in my opinion i have learned a lot from you . greetings from egypt
@fathimafarahna2633
@fathimafarahna2633 2 жыл бұрын
Simply good 👍 You are helping so many ppl in their journey of learning.. keep it up. God bless✌
@techTFQ
@techTFQ 2 жыл бұрын
Thank you 😍
@Ismail-hd4yz
@Ismail-hd4yz 8 ай бұрын
Omg i was planning how to manage categories with multi level , and this will perfectly work for me. And most importantly i would able to all parents category and when user click on any of that i can get all which belongs to that specific category. My problem solved
@hadibq
@hadibq 2 жыл бұрын
Brilliant Thoufiq! great way of putting things! TY!
@techTFQ
@techTFQ 2 жыл бұрын
Glad you enjoyed it Hadi
@zhipengliu4767
@zhipengliu4767 8 ай бұрын
Thank you! This tutorial helped me understand recursive sql statement. Thanks very much!
@linear_regression9541
@linear_regression9541 2 жыл бұрын
Man, you are simply brilliant! You were able to make me to understand this (I couldn't even do that at university lol). I just have one suggestion: could you explain not so fast? Thank you so much bro! Greetings from Paraguay!
@techTFQ
@techTFQ 2 жыл бұрын
Your welcome buddy.. Glad you liked it and noted on the suggestion 👍
@shafi123
@shafi123 2 жыл бұрын
Thanks Thoufiq for precise and clear explanation
@techTFQ
@techTFQ 2 жыл бұрын
Glad this helped Shaik :)
@shuchivardan375
@shuchivardan375 2 жыл бұрын
This is awesome! I have been looking to achieve this in SQL for sometime now. Thanks for sharing!
@faizanwar_
@faizanwar_ Жыл бұрын
Thoufiq Sir , you are best in the business for sure
@techTFQ
@techTFQ Жыл бұрын
thanks buddy
@pradyumnamohapatra2448
@pradyumnamohapatra2448 Жыл бұрын
so clearly explained Taufiq...your videos really do magic...thank you so much and keep posting such learning videos
@vamsykamal8932
@vamsykamal8932 2 жыл бұрын
Ethical Vlogging !! kudos. Disclosing sponsorships @ very beginning. Hard to find such practice these days.
@Paragkini
@Paragkini 2 жыл бұрын
Excellent info... Have always been thinking of handling it through code. Thanks bro.
@techTFQ
@techTFQ 2 жыл бұрын
Glad this helped Parag :)
@rohankhanna8006
@rohankhanna8006 2 жыл бұрын
Love the way you explained. Very easy to understand
@techTFQ
@techTFQ 2 жыл бұрын
Thank you Rohan 🙏🏼
@gaberuth9274
@gaberuth9274 2 жыл бұрын
Fantastic Tutorial. Thank you for actually explaining what the code is doing!
@muthumariponmurugan7187
@muthumariponmurugan7187 2 жыл бұрын
Hi Thoufiq, Thanks for your great job. I got a clear understanding of how to analyze a problem and its implementation. Looking forward to more such videos.Thank you
@techTFQ
@techTFQ 2 жыл бұрын
Glad it helped MuthuMari
@lambdaboss5528
@lambdaboss5528 2 жыл бұрын
Another awesome video. Very well explained and easy to understand. Thanks.
@techTFQ
@techTFQ 2 жыл бұрын
Thank you so much ☺️
@finix7419
@finix7419 2 ай бұрын
finally I understood this concept thanks to this video
@deepapanneerselvam4618
@deepapanneerselvam4618 2 жыл бұрын
Mind blowing explanation ..awesome😍😍😍.. Wonderful lectures .. I admired the way to explain the each and evry concepts from scratch to advancced level.
@sreejitchakraborty6575
@sreejitchakraborty6575 2 жыл бұрын
Beautiful explanation. The way you explain concepts is crystal clear. Thanks for the amazing videos.
@techTFQ
@techTFQ 2 жыл бұрын
Thank you so much ☺️
@suyash7450
@suyash7450 Жыл бұрын
Watching your videos makes me Believe that Learning SQL is not that difficult as it seems when we learn from an online course or any other portal, your way of explaining concepts both theoretical and practical is very simple and even a beginner can learn with ease. keep doing the great work.
@Momo-qr3rd
@Momo-qr3rd 2 жыл бұрын
Thank you very much🙏😊 It helped me a lot. Watching only one tutorial, made me follow and watch all of your videos. It is a great way to explain complex topics like this with examples. Could you please share your database for each of your tutorials so can pactise with it? Of course I could create it myself but its easier if you would share it.
@techTFQ
@techTFQ 2 жыл бұрын
Thank you bro .. glad you liked it.. As for dataset, I always share it either in my blog or in my discord. For this video, you can get it from my discord
@sravangoud9700
@sravangoud9700 2 жыл бұрын
+1
@techTFQ
@techTFQ 2 жыл бұрын
Thank you bro
@johnsaleem470
@johnsaleem470 2 жыл бұрын
Thank you Tafiq for such a wonderful job. You are an excellent teacher, and I have learned SQL from your channel. Keep it up, and be good.
@kaiyao5135
@kaiyao5135 2 жыл бұрын
Thanks so much! very clear and details, love your tutorials!
@techTFQ
@techTFQ 2 жыл бұрын
Thank you :)
@cgittoes
@cgittoes 11 ай бұрын
Great video. Helped made a complex topic easy to understand and follow
@puneetaggarwal7549
@puneetaggarwal7549 Жыл бұрын
Looking at your queries and way of explanation I wonder why I wasted my money on some SQL course. God why didn't I find your playlist earlier.
@satheeshkumarak6708
@satheeshkumarak6708 2 жыл бұрын
Such a Masterpiece!!!
@techTFQ
@techTFQ 2 жыл бұрын
Thank you bro
@jaewonyang
@jaewonyang Жыл бұрын
Excellent explanation! Thank you very much.
@maximilianjaeger8545
@maximilianjaeger8545 2 жыл бұрын
10 out of 10 Video🤝
@cooldwnload
@cooldwnload 2 жыл бұрын
Great work to bring in all concepts 👍
@techTFQ
@techTFQ 2 жыл бұрын
Thanks a lot 😊
@AsadAli-wi1xs
@AsadAli-wi1xs 2 жыл бұрын
Supereb content 👌👌👌
@techTFQ
@techTFQ 2 жыл бұрын
Thank you 🙏🏼
@kanthamani6444
@kanthamani6444 2 жыл бұрын
Superb explanation and Excellent Content
@ganeshv791
@ganeshv791 2 жыл бұрын
Awesome got a clear picture on recursion. Please make videos related to dynamic queries in PostgreSQL. One humble request I need clear cut guidance on Service Broker. Thanks....
@techTFQ
@techTFQ 2 жыл бұрын
Thank you buddy and noted on the request
@QelDoQ
@QelDoQ Жыл бұрын
Thank you! This explained things so clearly.
@hiajayy
@hiajayy 2 жыл бұрын
Please make videos on procedures and functions. Btw you are doing fabulous job.♥️
@techTFQ
@techTFQ 2 жыл бұрын
Thank you Ajay and sure will do
@swamivivekananda-cyclonicm8781
@swamivivekananda-cyclonicm8781 2 жыл бұрын
Fanstastic explanation. You have gift of explaining concepts.
@vijaykumar-sy3uu
@vijaykumar-sy3uu Жыл бұрын
Thanks a Lot Thoufiq for Making great content😀 .Request:: Please make video on UDF
@jaydeeppatidar4189
@jaydeeppatidar4189 2 жыл бұрын
Very well explained! Thank you!
@techTFQ
@techTFQ 2 жыл бұрын
Glad it was helpful!
@raghud541
@raghud541 2 жыл бұрын
Thanks a lot for this wonderful explanation.
@techTFQ
@techTFQ 2 жыл бұрын
Your welcome 🙏🏼
@sindhuridevatha8383
@sindhuridevatha8383 2 жыл бұрын
Very informative and nice explanation
@shankerm3959
@shankerm3959 2 жыл бұрын
Well explained and i find it useful. Thank you.
@ismailrana
@ismailrana Жыл бұрын
Excellent, I really love your all videos.
@prajwalsiwakoti9866
@prajwalsiwakoti9866 2 жыл бұрын
Thank u so much . Could you please make a video on database indexing in detail like what is it, how to do indexing and its usage? Thank you in advance
@techTFQ
@techTFQ 2 жыл бұрын
Sure Prajwal , will consider doing it
@pressi14188
@pressi14188 2 жыл бұрын
Great concept and I love your videos
@dotangabay1056
@dotangabay1056 2 жыл бұрын
Perfect explanation!
@flashborn-band
@flashborn-band Жыл бұрын
Awesome video, very well explained. Thank you. Just one little thing with the last example. I wished you would have changed the level number backwards somehow.
@jullienb2055
@jullienb2055 Жыл бұрын
Superb explanation! 👏
@techTFQ
@techTFQ Жыл бұрын
Thank you 🙂
@ytef9398
@ytef9398 Жыл бұрын
Wooah.. you deserve many subscription. Many thanks, you save my week.. One question, is this work well for a big data row, or better using another method?
@yokeshkb5628
@yokeshkb5628 13 күн бұрын
That was a great explanation
@vinodkumarmannepuram5902
@vinodkumarmannepuram5902 28 күн бұрын
your explanation on SQL are sky level. can you please suggest me best sites for python learning.
@LiveNobin
@LiveNobin 2 жыл бұрын
Hi Thoufiq, Thank you for this video.
@techTFQ
@techTFQ 2 жыл бұрын
Your welcome buddy
@ashutoshbafna6617
@ashutoshbafna6617 2 жыл бұрын
thank you. you explained beautifully. please give some examples to practice apart from what you have solved - to check learning on these concepts, if possible. thanks a lot .
@techTFQ
@techTFQ 2 жыл бұрын
Thank you Ashutosh :) will consider you request.
@majidnabavi9900
@majidnabavi9900 Жыл бұрын
Best explanation , thank you ;)
@jerilcj9586
@jerilcj9586 2 жыл бұрын
well explained something complex. Thanks
@davidhickman4976
@davidhickman4976 2 жыл бұрын
Very useful video. Thank you!
@techTFQ
@techTFQ 2 жыл бұрын
Glad it helped
@AnkitaCreative
@AnkitaCreative 2 жыл бұрын
Amazing as always.
@techTFQ
@techTFQ 2 жыл бұрын
Thank you :)
@cheogt4623
@cheogt4623 2 жыл бұрын
Beautiful !!! Thx man
@techTFQ
@techTFQ 2 жыл бұрын
Glad you like it!
@kancharalaparameshwarreddy3837
@kancharalaparameshwarreddy3837 2 жыл бұрын
excellent video sir
@techTFQ
@techTFQ 2 жыл бұрын
Many many thanks bro
@itzmemk1529
@itzmemk1529 2 жыл бұрын
Thanks for this content man. 🔥
@techTFQ
@techTFQ 2 жыл бұрын
Your welcome buddy
@kokarao4874
@kokarao4874 5 ай бұрын
Very detail explanation
@indrajithserasinghe6766
@indrajithserasinghe6766 2 жыл бұрын
really good and very good explanation
@techTFQ
@techTFQ 2 жыл бұрын
Thank you 🙏🏼
@sambacarlson
@sambacarlson 3 ай бұрын
Thanks man. really useful.
@ayanSaha13291
@ayanSaha13291 2 жыл бұрын
You are fantastic! Thanks a lot.
@techTFQ
@techTFQ 2 жыл бұрын
Thank you Ayan
@shaikhanuman8012
@shaikhanuman8012 Жыл бұрын
Tq for sharing valuable information, sir.
@nisha6165
@nisha6165 2 жыл бұрын
Hi, pls try to post complete vedio on stored procedures and thanks for this vedio
@techTFQ
@techTFQ 2 жыл бұрын
Sure Nisha will do it soon
@nisha6165
@nisha6165 2 жыл бұрын
@@techTFQ Thanks you🙂
@absolutedesi3232
@absolutedesi3232 2 жыл бұрын
please make a video on triggers , stored procedures and pragma as well , Thank you.
@techTFQ
@techTFQ 2 жыл бұрын
Sure will do
@rajaguru7151
@rajaguru7151 2 жыл бұрын
really interesting ! Thank you !
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
REAL SQL Interview Problem | Hierarchical data in SQL
22:09
SQL Recursion with CTE Part 1 | Quick Tips Ep59
38:51
Joey Blue
Рет қаралды 28 М.
SQL Views Tutorial | VIEWS in SQL Complete Tutorial
43:20
techTFQ
Рет қаралды 296 М.
Learn SQL In 60 Minutes
56:24
Web Dev Simplified
Рет қаралды 2,2 МЛН
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН