CTE in SQL (Common Table Expression) | SQL WITH Clause | CTE Query Performance | Advanced SQL

To enhance your career as a Cloud Data Engineer, Check trendytech.in/?src=youtube&su... for curated courses developed by me.
I have trained over 20,000+ professionals in the field of Data Engineering in the last 5 years.
CTE in SQL | Common Table Expression | SQL WITH Clause | CTE Query Performance | Advanced SQL
In this video you will learn about CTE (Common table expressions) In SQL. The WITH clause really simplifies the complicated queries, and makes the SQL queries readable.
with Inner query we can see the code getting messy and there is a lot of redundancy.
Also we have talked about the performance of queries using CTE.
We even saw how CTE can degrade the performance.
CTE is very important from SQL Interview perspective, I hope this video should have given you a good idea on how to work with Common table expression in SQL.
J𝗼𝗶𝗻 𝗺𝗲 𝗼𝗻 𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:🔥
🔅Sumit LinkedIn - / bigdatabysumit
🔅Sumit Instagram - / bigdatabysumit
If you haven't subscribed to the channel then please do subscribe for more insightful content
#CTE #AdvancedSQL #WITHClause #bigdata #dataengineering

Пікірлер: 91

  • @sumitmittal07
    @sumitmittal07 Жыл бұрын

    Checkout the Big Data course details here: trendytech.in/?referrer=youtube_sqladv1

  • @vikastiwari901
    @vikastiwari9012 жыл бұрын

    Thankyou for the video Sir. 3 months back I started preparing for interviews. I have watched almost all of your videos here. It helped me a lot in interviews. Today I have 7+ offer and all from top product companies. Invest in yourself, you will get best ROI... In my case 6x in 14 months. And Sumit sir played a very important role.

  • @abhimanyutiwari100

    @abhimanyutiwari100

    2 жыл бұрын

    Hi, which profile vikash? Data engineer? I'm in Data analyst position and CTC is not that good (~4 LPA) Is it possible to increase my CTC to 8~9 LPA within 1 year?

  • @vikastiwari901

    @vikastiwari901

    2 жыл бұрын

    @@abhimanyutiwari100 yeah i am a data engineer. u can definitely expect a good number provided u r prepared well

  • @vikassrivastava7081

    @vikassrivastava7081

    2 жыл бұрын

    @@vikastiwari901 bro what imp topics we need to cover for data engineer profile?

  • @ajaypatil5152

    @ajaypatil5152

    Жыл бұрын

    Hi, can you please tell mi which topics are mostly asked in interviews and what is the level of questions asked for SQL ? Cause now I am feeling like that I am preparing everything and I am confusing myself.

  • @adityatripathy0000
    @adityatripathy0000 Жыл бұрын

    Just a suggestion please share the table and it's contents as a link in video. So that while learning we can practice side by side. Btw, course is very helpful and builds confidence in SQL.

  • @rtecunit602

    @rtecunit602

    Ай бұрын

    i really like this suggestion, and would like to see this as well

  • @akshayzade3153
    @akshayzade31532 жыл бұрын

    I learn with clause on my own after referring bunch of codes in project that i am working on, took lot of time to understand it. Now that i know it, got addicted to it, its very useful. Wish i would have seen this video earlier Thanks Sumit Sir

  • @prashanttripathi6135
    @prashanttripathi6135 Жыл бұрын

    The depth in your videos is incredible!

  • @tejasvik4832
    @tejasvik483216 күн бұрын

    "Fantastic explanation! Your detailed breakdown of the concepts and step-by-step walkthrough made it easy to follow along. The examples you provided really helped to clarify the more complex parts. Thank you for making such an informative and well-structured video!"

  • @kiransuresh4078
    @kiransuresh4078 Жыл бұрын

    It's one of the best tutorial with in depth explanations and clarity. You just made understanding & working of CTE so easy with your explanations sir. Hats off to you for this.

  • @dasubabu5210
    @dasubabu52102 жыл бұрын

    This tutorial gave full clarity on CTE(With clause). Thank you sir. Could you please make videos on hints and optimization tuning? It will help us a lot.

  • @rajorshi1000
    @rajorshi10002 жыл бұрын

    Excellent in-depth video Sumit sir. Really liking it and will benefit us to a great extent.

  • @yashgarg9458
    @yashgarg94582 жыл бұрын

    explained very clearly!! hats off

  • @martinsnwokolo6554
    @martinsnwokolo6554 Жыл бұрын

    Thanks for the explanations. It has made CTE and subqueries clearer.👌

  • @GauravSharmagvs
    @GauravSharmagvs2 жыл бұрын

    Thank you for such a nice and informative tutorial on CTE. This cleared a lot of doubts.

  • @AmitSingh-ut4wt
    @AmitSingh-ut4wt2 жыл бұрын

    Thank you so much for the detailed video for CTE

  • @pratikgugliya3771
    @pratikgugliya37712 жыл бұрын

    Thank you @ Sumit Mittal Sir for an amazing video on CTE.

  • @kashmirshadows8150
    @kashmirshadows81502 жыл бұрын

    Was eagerly waiting for it Thank you Sumit

  • @MoinKhan-cg8cu
    @MoinKhan-cg8cu2 жыл бұрын

    Please create one vedio with the brief description of all the topics which u r going to cover in Advance SQL playlist.

  • @arunsundar3739
    @arunsundar37393 ай бұрын

    CTE looked like a mysterious concept initially after just looking into some of the articles from google search, this video has made it look easy to grasp its purpose, syntax, benefits, possible limitations & internals, explained in a way that makes learning interesting & joyful, thank you very much sir :)

  • @nepalbudha8270
    @nepalbudha8270 Жыл бұрын

    It is really advanced CTE concept 😊😊😊😊

  • @sagnikchakraborty734
    @sagnikchakraborty734 Жыл бұрын

    Great lecture sir........thank you 👏

  • @DeepakSharma-pn8yt
    @DeepakSharma-pn8yt2 жыл бұрын

    Amazing Lecture.

  • @mallikarjunpatil7553
    @mallikarjunpatil75532 жыл бұрын

    Thanks, very good explanation, please keep on providing right knowledge to all of us😊 Please do videos on optimizations...

  • @kushalSaini144
    @kushalSaini144 Жыл бұрын

    great.. thank you so much!!

  • @prashantguptanz
    @prashantguptanz2 жыл бұрын

    SQL tuning and optimization please sir!! Thank you and really great work.

  • @funnyvideo-ho6mw
    @funnyvideo-ho6mw Жыл бұрын

    best video on cte

  • @TrustinData
    @TrustinData Жыл бұрын

    Great video sir . thanks for the effort

  • @r_s7927
    @r_s79279 ай бұрын

    Very nicely explained , Maza aa gya :) !!

  • @Dusky0307
    @Dusky03073 ай бұрын

    Well explained. Thank you sir :)

  • @gouthamganesh2324
    @gouthamganesh23242 жыл бұрын

    Thank you sir, Do more please sirrr...

  • @abhaypartapsingh9767
    @abhaypartapsingh97672 жыл бұрын

    This video is very helpful sir, i have used CTE before but didn't know about having more than 1 table in WITH clause. Can you also explain about in your next video. Thankyou Sir

  • @sparshkapoor8517
    @sparshkapoor8517 Жыл бұрын

    Marvellous💯

  • @harshal3123
    @harshal3123 Жыл бұрын

    Thanks sir It helps alot

  • @akashgholve3550
    @akashgholve3550 Жыл бұрын

    Make more videos sir, we'd appreciate them if posted soon, thankyou

  • @tejeswarpala2841
    @tejeswarpala2841 Жыл бұрын

    first the video length discouraged me. but later I felt that its worthy.

  • @supriyadhole8890
    @supriyadhole8890 Жыл бұрын

    It Is very helpful!

  • @dattatraysuryawanshi934
    @dattatraysuryawanshi9343 ай бұрын

    Great explanation

  • @sahilkasana2403
    @sahilkasana24032 жыл бұрын

    Thank you so much sir for this video, it was really helpful. Please make video on Facts and Dimensions also, you explain so well and these are important topics as well..Please please

  • @nocode659
    @nocode6592 жыл бұрын

    love u sir

  • @ayushagrawal9633
    @ayushagrawal96332 жыл бұрын

    Sir please continue the series where you used to solve leet code problems

  • @ReshabSah
    @ReshabSah2 жыл бұрын

    Awesome 😎👍

  • @tushartiwari7929
    @tushartiwari79292 жыл бұрын

    Thank you sir, Can you do a video on TRANSACTION, COMMIT, and ROLLBACK Statements ?

  • @namahshiva6972
    @namahshiva6972 Жыл бұрын

    Great 👍👍

  • @chesswithmoiz
    @chesswithmoiz3 ай бұрын

    excellent

  • @ayushvanvary
    @ayushvanvary2 жыл бұрын

    Sir... Your are killing it... 💯💯❤ ,Best sql series available on internet.

  • @sumitmittal07

    @sumitmittal07

    2 жыл бұрын

    Thank you. Happy to know that you are liking the series.

  • @muhmdayeshafatimamariarnge6968

    @muhmdayeshafatimamariarnge6968

    2 жыл бұрын

    @@sumitmittal07 request sir window functions and anaytical function , i mean with your series end result is cracking MANG . once series completed we should crack mang , refer Ankit Bansal youtube

  • @muhmdayeshafatimamariarnge6968

    @muhmdayeshafatimamariarnge6968

    2 жыл бұрын

    @@sumitmittal07 cte , stored proc as one one query we dont fire , sql execution plan and correcting performance , recursive queries in sql topic

  • @muhmdayeshafatimamariarnge6968

    @muhmdayeshafatimamariarnge6968

    2 жыл бұрын

    @@sumitmittal07 visit clever studies channel 6 concepts in one query mean prepare one doc where 6-7 concepts used together sql query like union + filter + recursive query + withclause + having you can vsit data is good youtube channel , clever studies sql list , cloudyml youtube , Ankit bansal the level is increased

  • @sebastiansrikanth
    @sebastiansrikanth11 ай бұрын

    Sumit Sir, really enjoyed this video a lot, I just know about CTE but not with CTE (column_1, column_2), this is super understandable. I would love to know how are you able to run the SQL query in VS code, please help me too. Thank you Sir. :)

  • @email5940
    @email59402 жыл бұрын

    Please launch more sessions for advance SQL as soon as possible sir..it's a request..I'm learning via your videos so desperately wait for your classes..

  • @muni939
    @muni9392 жыл бұрын

    Nested queries concept is it important

  • @saurabhrajput7482
    @saurabhrajput7482 Жыл бұрын

    Sir kindly provide the tables for practice it would help most of us for practice

  • @Aks-47
    @Aks-472 жыл бұрын

    thank you sir...next video when?

  • @hasanmougharbel8030
    @hasanmougharbel8030 Жыл бұрын

    Hey dear, god bless your efforts in this channel. I have a general enquiry as a new sql learner. How could i create a pipeline to extract and load data from existing accounting program into our SQL server instances. How can i know if the export mechanism in the software permits me to undertake this extraction process, and how can i know if an application have an api? Thanks for taking care of my enquires. Looking forward to gain more knowledge from you.

  • @vikneshwararb3354
    @vikneshwararb3354 Жыл бұрын

    Hello sir.Will you post videos on Data modelling concepts?

  • @atishayjain5321
    @atishayjain53212 жыл бұрын

    Sir please upload content faster btw the video is awesome

  • @sumitmittal07

    @sumitmittal07

    2 жыл бұрын

    Happy that you like the content. Will try to keep up the pace.

  • @ujjwalnishchal2631
    @ujjwalnishchal26312 жыл бұрын

    Really good

  • @sumitmittal07

    @sumitmittal07

    2 жыл бұрын

    Glad that you are liking it.

  • @anjibabumakkena
    @anjibabumakkena9 ай бұрын

    Can u make a video on Stored procedure

  • @amanpathak7507
    @amanpathak7507 Жыл бұрын

    please create a video on fact and dimension , row and columnar data, transactional and time series database

  • @tanushreepareek8208
    @tanushreepareek8208 Жыл бұрын

    Can you please share the create and insert syntax for this table?

  • @prabhatmishra160
    @prabhatmishra1602 жыл бұрын

    sir leet code series and sql optimization as well

  • @sumitmittal07

    @sumitmittal07

    2 жыл бұрын

    Sure, noted.

  • @greatmonk
    @greatmonk Жыл бұрын

    We can use below subquery approach: select order_customer_id,count(*) as total_count from orders group by order_customer_id having total_count > (select avg(total_count) as average_count from (select order_customer_id,count(*) as total_count from orders group by order_customer_id) derivedtable) ; Can we use CTE on this ??

  • @sigmarule1779
    @sigmarule1779 Жыл бұрын

    I'm happy to see Deepak Kalal teaching us SQL. Nice video though ❤️

  • @rabink.5115
    @rabink.5115 Жыл бұрын

    It would have even better if data sources were also been shared.

  • @santanuroy2121
    @santanuroy2121 Жыл бұрын

    Hello Sumit Sir, Just Now I have watched CTE Video. Its totally Understand to me. Can you please Create One another video for CTE for us.. Topic is "Parent - Child Category Concept" What I mean let say in a Category table there is 2 columns. 1. category_id (Primary key and Autoincrement) 2. parent_category_id (value of category_id) that means recursive query (nested). Example: Category Id Parent_category_id 1 0 2 0 3 1 4 1 5 2 6 3 7 1 8 0

  • @sc4647
    @sc46472 жыл бұрын

    which is the first video of this Advance video where worksheet is logged in. i can not work this in groom. please advice

  • @debashish_dutta
    @debashish_dutta2 жыл бұрын

    Hi Sir, Can we write the below fashion for the premium customers (36:29) select order_customer_id from total_orders where total_orders_per_customer > (select avg_order_per_customer from average_orders) NOTE: Only to get the customer_id not the rest of the columns.

  • @ft_peakhd2921

    @ft_peakhd2921

    Жыл бұрын

    unless they've given us total_orders and average_orders tables in the data, we can't use the query you've written.

  • @tarunbhatt5003
    @tarunbhatt5003 Жыл бұрын

    The orders table is from the retail_db database

  • @mannykhan7752
    @mannykhan77525 ай бұрын

    The way I write SQL queries is to capitalize the commands and use lower case for the tables. That way it stays really clean. Just an opinion.

  • @dhinaronaldo9913
    @dhinaronaldo99132 жыл бұрын

    Pls take cursor classes

  • @techtransform
    @techtransform2 жыл бұрын

    First one to like :)

  • @lalithroy
    @lalithroy3 ай бұрын

    can you provide table script....?

  • @nagaharikakalugotla8139
    @nagaharikakalugotla8139 Жыл бұрын

    Hi sir, could you please cover stored procedures , functions, triggers ad well Else is their any paid course available let me know sir . Thanks in advance

  • @supriyodey7655
    @supriyodey7655 Жыл бұрын

    Where CTE is stored? which approach is better?

  • @anupgupta5781
    @anupgupta57812 жыл бұрын

    First view

  • @madastarun5166
    @madastarun51662 жыл бұрын

    normalisation concept 🌚

  • @ashwinkumar5223
    @ashwinkumar5223 Жыл бұрын

    Please share tables

  • @vikashkumargupta78
    @vikashkumargupta782 жыл бұрын

    My gap year is 5 years so can you help me to enter into it industry. My skill is oracle

  • @amalkumar5201
    @amalkumar5201 Жыл бұрын

    Sir aap se lecture join karna chahte h

  • @ALOKMOHANTY-fx3ol
    @ALOKMOHANTY-fx3ol2 ай бұрын

    WITHOUT SHARING THE TABLE AND WITHOUT DOING IT PARALLELY IT BECOMES DIFFICULT TO FOLLOW AFTER A WHILE.

  • @SG-zb3jb
    @SG-zb3jb Жыл бұрын

    This Onecompiler doesnt work sir ... You should always put down sql scripts in comment box for ppl to practice paralelly .