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

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 98

  • @sumitmittal07
    @sumitmittal07  2 роки тому

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

  • @kunaljain-l8l
    @kunaljain-l8l 16 днів тому

    Easy explanation for a difficult topic . Advised to watch at 1.5X speed.

  • @vikastiwari901
    @vikastiwari901 2 роки тому +17

    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 роки тому +1

      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.

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

    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 :)

  • @tejasvik4832
    @tejasvik4832 5 місяців тому +2

    "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!"

  • @akshayzade3153
    @akshayzade3153 2 роки тому +1

    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

  • @tejeswarpala2841
    @tejeswarpala2841 Рік тому +3

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

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

      haha so true , same with my case
      short code of content is causing trouble for us 🙃

  • @adityatripathy0000
    @adityatripathy0000 2 роки тому +22

    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 6 місяців тому

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

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

      ​@@rtecunit602, sir, you use any sales/product dataset. You can even create your own dammy/training dataset

  • @MoinKhan-cg8cu
    @MoinKhan-cg8cu 2 роки тому +4

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

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

    Very thanks sir for your valuable time and energy...

  • @martins24h
    @martins24h Рік тому

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

  • @nepalbudha8270
    @nepalbudha8270 Рік тому

    It is really advanced CTE concept 😊😊😊😊

  • @yashgarg9458
    @yashgarg9458 2 роки тому +1

    explained very clearly!! hats off

  • @pratikgugliya3771
    @pratikgugliya3771 2 роки тому

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

  • @prashanttripathi6135
    @prashanttripathi6135 Рік тому

    The depth in your videos is incredible!

  • @dasubabu5210
    @dasubabu5210 2 роки тому +4

    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.

  • @funnyvideo-ho6mw
    @funnyvideo-ho6mw Рік тому

    best video on cte

  • @AmitSingh-ut4wt
    @AmitSingh-ut4wt 2 роки тому

    Thank you so much for the detailed video for CTE

  • @kiransuresh4078
    @kiransuresh4078 2 роки тому

    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.

  • @r_s7927
    @r_s7927 Рік тому

    Very nicely explained , Maza aa gya :) !!

  • @prashantguptanz
    @prashantguptanz 2 роки тому +2

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

  • @GauravSharmagvs
    @GauravSharmagvs 2 роки тому

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

  • @greatmonk
    @greatmonk Рік тому +1

    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 ??

  • @Dusky0307
    @Dusky0307 8 місяців тому

    Well explained. Thank you sir :)

  • @supriyadhole8890
    @supriyadhole8890 Рік тому

    It Is very helpful!

  • @dattatraysuryawanshi934
    @dattatraysuryawanshi934 8 місяців тому

    Great explanation

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

    Thank you Sir, Please add some more topics like sql query optimization and all

  • @sagnikchakraborty734
    @sagnikchakraborty734 2 роки тому

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

  • @DeepakSharma-pn8yt
    @DeepakSharma-pn8yt 2 роки тому

    Amazing Lecture.

  • @rajorshi1000
    @rajorshi1000 2 роки тому

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

  • @akashgholve3550
    @akashgholve3550 2 роки тому +1

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

  • @harshal3123
    @harshal3123 2 роки тому

    Thanks sir
    It helps alot

  • @kashmirshadows8150
    @kashmirshadows8150 2 роки тому

    Was eagerly waiting for it
    Thank you Sumit

  • @sparshkapoor8517
    @sparshkapoor8517 Рік тому

    Marvellous💯

  • @kushalSaini144
    @kushalSaini144 2 роки тому

    great.. thank you so much!!

  • @TrustinData
    @TrustinData 2 роки тому

    Great video sir . thanks for the effort

  • @gouthamganesh2324
    @gouthamganesh2324 2 роки тому

    Thank you sir, Do more please sirrr...

  • @ayushvanvary
    @ayushvanvary 2 роки тому

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

    • @sumitmittal07
      @sumitmittal07  2 роки тому +1

      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 роки тому +1

      @@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

  • @hasanmougharbel8030
    @hasanmougharbel8030 2 роки тому

    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.

  • @sebastiansrikanth
    @sebastiansrikanth Рік тому

    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. :)

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

    It is good to use CTE when there are Complex queries.
    But its good, not to use CTE when single and recursive queries as CTE. Bcoz it may degrade the performance.
    Correct me if I am wrong.

  • @vikneshwararb3354
    @vikneshwararb3354 Рік тому

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

  • @ayushagrawal9633
    @ayushagrawal9633 2 роки тому +1

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

  • @mallikarjunpatil7553
    @mallikarjunpatil7553 2 роки тому

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

  • @saurabhrajput7482
    @saurabhrajput7482 2 роки тому

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

  • @atishayjain5321
    @atishayjain5321 2 роки тому +2

    Sir please upload content faster
    btw the video is awesome

    • @sumitmittal07
      @sumitmittal07  2 роки тому +1

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

  • @abhaypartapsingh9767
    @abhaypartapsingh9767 2 роки тому

    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

  • @anjibabumakkena
    @anjibabumakkena Рік тому

    Can u make a video on Stored procedure

  • @muni939
    @muni939 2 роки тому

    Nested queries concept is it important

  • @mannykhan7752
    @mannykhan7752 10 місяців тому

    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.

  • @sahilkasana2403
    @sahilkasana2403 2 роки тому

    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

  • @debashish_dutta
    @debashish_dutta 2 роки тому +1

    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 2 роки тому

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

  • @tanushreepareek8208
    @tanushreepareek8208 Рік тому

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

  • @namahshiva6972
    @namahshiva6972 Рік тому

    Great 👍👍

  • @sigmarule1779
    @sigmarule1779 2 роки тому

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

  • @amanpathak7507
    @amanpathak7507 2 роки тому

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

  • @prabhatmishra160
    @prabhatmishra160 2 роки тому +2

    sir leet code series and sql optimization as well

  • @chesswithmoiz
    @chesswithmoiz 8 місяців тому

    excellent

  • @rabink.5115
    @rabink.5115 2 роки тому +1

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

  • @nagaharikakalugotla8139
    @nagaharikakalugotla8139 2 роки тому

    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

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

    Please upload pyspark course also sir

  • @tushartiwari7929
    @tushartiwari7929 2 роки тому

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

  • @ReshabSah
    @ReshabSah 2 роки тому

    Awesome 😎👍

  • @santanuroy2121
    @santanuroy2121 2 роки тому

    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

  • @lalithroy
    @lalithroy 8 місяців тому

    can you provide table script....?

  • @nocode659
    @nocode659 2 роки тому

    love u sir

  • @supriyodey7655
    @supriyodey7655 2 роки тому

    Where CTE is stored? which approach is better?

  • @tarunbhatt5003
    @tarunbhatt5003 2 роки тому

    The orders table is from the retail_db database

  • @Aks-47
    @Aks-47 2 роки тому

    thank you sir...next video when?

  • @amalkumar5201
    @amalkumar5201 Рік тому

    Sir aap se lecture join karna chahte h

  • @ILikeDWayIam
    @ILikeDWayIam 2 роки тому

    Pls take cursor classes

  • @ujjwalnishchal2631
    @ujjwalnishchal2631 2 роки тому

    Really good

  • @vikashkumargupta78
    @vikashkumargupta78 2 роки тому

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

  • @techtransform
    @techtransform 2 роки тому

    First one to like :)

  • @madastarun5166
    @madastarun5166 2 роки тому

    normalisation concept 🌚

  • @ashwinkumar5223
    @ashwinkumar5223 2 роки тому

    Please share tables

  • @anupgupta5781
    @anupgupta5781 2 роки тому

    First view

  • @ALOKMOHANTY-fx3ol
    @ALOKMOHANTY-fx3ol 7 місяців тому

    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 .