SQL Amazing Trick | Calculate Yearly, Quarterly, Monthly totals in a single SQL Query |Grouping Sets

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • In this tutorial, we learn to use Grouping Sets in SQL to calculate aggregations at different levels by taking the example -
    How to calculate Yearly, Quarterly, Monthly totals in a single SQL Query?
    All DDL and SQL statements can be found here-
    know-star.blog...
    How to install SQL Server for practice?
    • How to install SQL Ser...
    Check out the complete list of SQL Query Interview Questions -
    • SQL Query Interview Qu...
    Best Data Science / Analytics / SQL courses
    Learn SQL Basics for Data Science Specialization
    imp.i384100.ne...
    Beginners to Python Programming
    skillshare.eqc...
    Data Science and Business Analytics with Python
    skillshare.eqc...
    Get 40% OFF of Skillshare with code FLASH40 - October 2022
    skillshare.eqc...
    Data Science Fundamentals with Python and SQL Specialization
    imp.i384100.ne...
    Python for Everybody Specialization
    imp.i384100.ne...
    Google Data Analytics Professional Certificate
    imp.i384100.ne...
    Coursera Plus - Data Science Career Skills
    imp.i384100.ne...
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - knowstar.org/
    Instagram - / learn.knowstar
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.c...
    Email - learn@knowstar.org

Komentáře • 46

  • @kristyowens2284
    @kristyowens2284 Před 2 lety +5

    Another amazing topic. Thank you for posting relevant content.

  • @hv0032113
    @hv0032113 Před 2 lety +1

    I learnt a new thing. Was not aware of Grouping Sets. Thank you for sharing.

  • @diydecor2653
    @diydecor2653 Před 2 lety +2

    Thank you. These topics are really helpful for us.

  • @rohanthakur6136
    @rohanthakur6136 Před 2 lety +1

    Real life scenario examples. Thank you for the examples.

  • @hasanmougharbel8030
    @hasanmougharbel8030 Před 2 lety +1

    Hey there, here we meet again.
    I have a general question as a new sql learner.
    How to set up adventure works on sql sever?
    Thanks for taking time for my enquiry.
    God bless you.

    • @LearnatKnowstar
      @LearnatKnowstar  Před 2 lety +1

      Please find here the tutorial on installing SQL Server and Adventure Works DB.
      czcams.com/video/ncj0EDzy_rw/video.html

  • @mainlykanchan8740
    @mainlykanchan8740 Před 2 lety

    Your videos help me a lot to understand queries and and process of solving . Thank you so much 🙏🏿🙏🏿🙏🏿

  • @TheWANO327
    @TheWANO327 Před rokem

    THANK you great explanation ,
    I have a question ?can, add another column to this same table where every row is total month next to the accumulate column

  • @djjiang3718
    @djjiang3718 Před rokem

    Good job! another good share! Thank you young lady for your hard work!👏👏👏

  • @dimpyrathore818
    @dimpyrathore818 Před 2 lety

    Very well explained. Amazing tutorial series. Very helpful to build logic and frame SQL queries.

  • @shekhark1139
    @shekhark1139 Před rokem

    Very informative, expecting script for the practise

  • @chintu2691994
    @chintu2691994 Před 2 lety +1

    Good example and great explanation.... Will this work in SQL server 2008 (Updates are in progress)

    • @LearnatKnowstar
      @LearnatKnowstar  Před 2 lety +1

      They should work. They were introduced as a new feature in SQL Server 2008.

  • @saktipadamukherjee455
    @saktipadamukherjee455 Před 5 měsíci

    Please give the datasets in description

  • @dorayoung5149
    @dorayoung5149 Před 6 měsíci

    Thank you for this video

  • @amukelaniebenezer406
    @amukelaniebenezer406 Před rokem

    Thanks for sharing

  • @capitantomate6938
    @capitantomate6938 Před 2 lety

    Excellent! Thanks for sharing!! 😀

  • @sankalpasarkar3540
    @sankalpasarkar3540 Před 2 lety

    Excellent example

  • @shreekantgosavi4726
    @shreekantgosavi4726 Před 2 lety

    This is really insightful thanks a lot

  • @TheVaibhavdang
    @TheVaibhavdang Před rokem

    Can't we use datepart function for the same excercise?

  • @erikaa2718
    @erikaa2718 Před rokem

    is datepart working for Weekly as well?

  • @vinodkumar-yz1bg
    @vinodkumar-yz1bg Před rokem

    Need daily and monthly

  • @zeeshanazeem5212
    @zeeshanazeem5212 Před 2 lety

    Lovin it.

  • @rk-ej9ep
    @rk-ej9ep Před 2 lety

    Super..

  • @ZeeNoorTrip
    @ZeeNoorTrip Před rokem

    I done know I get invalid month or year?

  • @starkwedder9787
    @starkwedder9787 Před rokem

    is there a way to do the same thing in Sqlite ? Thank you

    • @LearnatKnowstar
      @LearnatKnowstar  Před rokem

      SQLLite has limited functions - so this might not work there. There are other similar functions - CUBE and ROLLUP. You might give those a try in SQLLite.

  • @sagarmagdum7407
    @sagarmagdum7407 Před rokem

    Make understand us CTE Function in detail videos real time example

  • @TheVaibhavdang
    @TheVaibhavdang Před 2 lety +1

    Please share the dataset link or file

    • @LearnatKnowstar
      @LearnatKnowstar  Před 2 lety

      Please find the link here -
      know-star.blogspot.com/2022/08/sql-how-to-calculate-yearly-quarterly.html

  • @lax976
    @lax976 Před 3 měsíci

    Union is a expensive operation, not good approach