Advanced Aggregate Functions in SQL (GROUP BY, HAVING vs. WHERE)

Поделиться
HTML-код
  • Опубликовано: 6 янв 2020
  • In this step-by-step video tutorial, you will learn some more advanced SQL aggregation concepts by using the GROUP BY, HAVING, and WHERE clauses!
    Learn about the BASIC aggregation Functions: • Basic Aggregate Functi...
    Queries:
    1) Pull aggregate information with the GROUP BY clause: SELECT column1, column2, COUNT(column3) FROM table GROUP BY column1, column2
    2) Use the HAVING clause to filter your aggregation: SELECT column1, COUNT(column2) FROM table GROUP BY column1 HAVING COUNT(column2) = 5
    3) Use WHERE and HAVING clauses in the same query: SELECT column1, COUNT(column2) FROM table WHERE column1 = 3 GROUP BY column1 HAVING COUNT(column2) = 5
    Get the Northwind Database: • How to Load a Sample P...
    Support the Channel:
    1) Subscribe: www.becomingads.com/o/youtube
    2) DataCamp:
    3) Udacity:
  • НаукаНаука

Комментарии • 256

  • @talalbow
    @talalbow 3 года назад +280

    You taught me in 6 minutes what my university class failed to teach me in 2 weeks lol
    Subscribed ❤️

    • @lauraaparicio3076
      @lauraaparicio3076 3 года назад +15

      Or even years, online education is amazing, the future of universities is a political issue but most of education should move to the digital environment in my opinion of course, I’m from Mexico y went to the university but i am updating my stack with platzi, the biggest platform to learn digital stuff, marketing, dev, data science, in Spanish is like udemy but even better and i love it

    • @ajinzrathod
      @ajinzrathod 2 года назад +4

      3 minutes in 2X speed

    • @andrematos3353
      @andrematos3353 2 года назад

      Same for me

    • @karlwhitford7523
      @karlwhitford7523 2 года назад +1

      Well you know what an unsigned byte address looks like after packing.

    • @hannahmeng4497
      @hannahmeng4497 2 года назад

      @@lauraaparicio3076 I agree with you!

  • @gustavshochat7792
    @gustavshochat7792 3 года назад +112

    Thanks for clarifying that WHERE cannot be used on aggregations. This is exactly what I was looking for regarding WHERE vs. HAVING. Not sure why I haven't seen this mentioned elsewhere, subscribed!

    • @markkoech289
      @markkoech289 Год назад +1

      Was looking for the same

    • @pharaoh9483
      @pharaoh9483 5 месяцев назад

      I dont get why it cant be used, in their documentatoin they also say u cant use them, but then they go on to provide examples like
      SELECT city, count(*) FILTER (WHERE temp_lo < 45), max(temp_lo)
      FROM weather
      GROUP BY city; which are combing both

    • @focusgratitude9724
      @focusgratitude9724 2 месяца назад

      ​@@markkoech289ditto 😊

  • @hankbreckenridge5680
    @hankbreckenridge5680 4 года назад +36

    These are amazing tutorials. Keep up the great work!

  • @eecolme
    @eecolme 2 года назад +8

    I'm so happy to finally found someone able to explain HAVING so easily. Thank you so much man

  • @majeyork
    @majeyork 2 года назад +1

    Thank you, I've spent a week trying to make it all make sense.
    You've just done that!

  • @sarahemslie6105
    @sarahemslie6105 4 года назад +4

    Thank you Nathan. So nicely explained in such a seemingly effortless way! Please keep up the great work as you might just keep me sane.

  • @SD-vj9rr
    @SD-vj9rr 2 года назад +2

    Finally understanding how GROUP BY & HAVING work, this was definitely helpful.

  • @Mori-Chan613
    @Mori-Chan613 Год назад +4

    This is easier to understand than what my online mentor taught me. Thank you!

  • @1800bth
    @1800bth Год назад

    Thank you for your concise delivery. Not too slow nor fast.

  • @COOKINGBIRD
    @COOKINGBIRD 11 месяцев назад +2

    Your SQL video was exactly what I needed. Thank you for explaining it so clearly. 😄🎬💻🔍

  • @colevarney8990
    @colevarney8990 3 года назад +10

    This was very helpful!! Cleared up a lot of confusion I am having in my undergrad database class. Clutch for my exam tomorrow! :)

  • @faiqahaider8296
    @faiqahaider8296 3 года назад +1

    Thank you so MUCH! I just loved the way you explained everything in this short video it helped me to understand very well. Please keep making short videos!

  • @mskafridi4815
    @mskafridi4815 3 года назад

    Straight to the point without any BS.. You are my hero

  • @groundbreakingdig
    @groundbreakingdig 2 месяца назад

    This is SOOO much clearer than what my instructor teaches at NAIT. Excellent tutorials.

  • @roymcpherson1639
    @roymcpherson1639 2 года назад

    This answered all my questions while doing the google data analytics certificate. Thanks for taking the time to do this.

  • @KozaiDesign
    @KozaiDesign Год назад

    That was the most helpful explanation. I kept having the trouble of understanding when and how to use these two.

  • @MadFunnyfails
    @MadFunnyfails Месяц назад

    for two years I've been struggling to understand how and when to use these clauses and you just taught me all that in 6 minutes. You are a legend. Thank you. It is going to save me from a lot of trouble from my Uni exam next week

  • @JoonJulyAugust
    @JoonJulyAugust Год назад +1

    learning relational database in university, this video helped a lot. thanks man!

  • @zenep63
    @zenep63 2 года назад

    One of the best video outhere. It really helped me out to understand what's the use of GROUP BY
    THANK YOU

  • @kopilkaiser8991
    @kopilkaiser8991 Год назад

    Thank you making such a great informational, informative, simplified video to teach us individuals who are willing to learn all of these topics discussed.

  • @goinggoinggone535
    @goinggoinggone535 3 года назад +4

    Just subscribed. If you ever get tired of BEING a data scientist, you should definitely go into teaching. You've got a knack for making complex things simple.

  • @VishalPatel-ly9uq
    @VishalPatel-ly9uq 3 года назад +7

    You are a legend, this guy saved my life In university. :D

  • @topazdazzlesDA
    @topazdazzlesDA 2 года назад

    Super simple, easy to follow! Thank you for uploading!

  • @neptune7153
    @neptune7153 2 месяца назад

    Thank you so much! I have my exam tomorrow and was always confused about when i can use what. No one could explain it to me and it took you 5 minutes lol your‘re a life saver

  • @elderaarondavis1
    @elderaarondavis1 11 месяцев назад

    I was lost reading through Microsoft SQL pages on HAVING vs WHERE, but with this video I got it right away😀 Thank you ❤

  • @sarahfinley6606
    @sarahfinley6606 2 года назад

    Thank you for sorting this out so clearly!

  • @danielangelov5948
    @danielangelov5948 9 месяцев назад

    You helped me a lot, i had a lot of issue with having and group by. Thank you

  • @Nam_David
    @Nam_David Год назад

    Thanks sir, it just take me 6 mins to watch but it's completely comprehensive. Amazing turorials, thanks for clarifying my confusion.

  • @GreenSlugg
    @GreenSlugg 2 года назад

    I've been struggling with a problem like this all day. Thank you!

  • @user-vf4pz1jw3u
    @user-vf4pz1jw3u Год назад

    Thank you! You made it so easy to understand. Much appreciated

  • @tosinoloruntoba449
    @tosinoloruntoba449 Год назад +1

    Great job Nathan so explicit

  • @alokjha780
    @alokjha780 10 месяцев назад

    Many thanks for this very short and crisp information. Thank you!!

  • @rungxanh2901
    @rungxanh2901 2 года назад +4

    A 6-minute watch saves me from a lengthy 2-hour lecture, not to mention the lecture didn't even serve its purpose of teaching us in such intuitive explanation ❤️

  • @lilygranger6264
    @lilygranger6264 Год назад

    This is a life savior!! Thank you THANK YOU!!!!!

  • @liamquiros
    @liamquiros 3 месяца назад

    Thank you so much. This is the video I was looking for! 🙌

  • @nicoborromeo1150
    @nicoborromeo1150 Месяц назад

    Very concise and clear! Thank you so much

  • @dumzi
    @dumzi 11 месяцев назад

    The clarity here is amazing

  • @v1tal_c
    @v1tal_c Год назад

    Thanks! Very helpful for my interview preparation recap.

  • @Sharry-M
    @Sharry-M 4 месяца назад

    Man I love your content! you're a savior! thanks for the educational videos!!

  • @maceb87
    @maceb87 3 года назад

    Best example i found so far, thank you!

  • @md.anisurrahman1723
    @md.anisurrahman1723 2 года назад

    You teach like an real expert.

  • @tomaspajonk8354
    @tomaspajonk8354 3 года назад

    Man your explanation is amazing. Ill check all of your's videos. Thank you a lot

  • @McCallumClips
    @McCallumClips 3 года назад +1

    Nice job. Thanks! Very useful and to the point. None of the stupid music or crazy intros!

  • @ras2930
    @ras2930 4 дня назад

    Oh my gosh! You answered the question that was stumping me the last few days. I’m taking the google analytics course and I keep having errors with my aggregate functions. When you added city to the SELECT clause, I keep doing that with the data set I’m working on and keep getting an error message. Then I saw you added country and city under GROUP BY which I have never done before so I think your video was the answer to my question. Thank you!!!

  • @ikeben400
    @ikeben400 2 года назад

    Superb video. Straight to the point and very concise 👍🏾

  • @geoafrikana
    @geoafrikana 2 года назад

    I love the tempo of this video. Thanks.

  • @mahfuzarrahman8897
    @mahfuzarrahman8897 2 года назад +1

    it is a 100% useful and effective tutorial. I really thank you so much.

  • @xternal2072
    @xternal2072 3 года назад +1

    great instructions man. I'm you can explain in great details in English I can fully understand cause a bunch of the tutorials I find is mostly from people in India and I just can't understand some the words they are saying. GREAT LESSONS AND VIDEOS IN DETAIL! GREAT INSTRUCTOR. Remember it takes 3 to 10 years to become a overnight success.

  • @Italjamer
    @Italjamer 2 года назад

    You are a lifesaver! Thank you!

  • @estebandiaz1306
    @estebandiaz1306 2 года назад

    Second video of yours I watch. You have such a great way of explaining things! Subscribed

  • @MariamOnTheRun
    @MariamOnTheRun 3 года назад +1

    great & simple explanations- thank you!

  • @alexrollins8356
    @alexrollins8356 Год назад

    Thank you for the quick tutorial!

  • @ashleyhouseknecht4042
    @ashleyhouseknecht4042 Год назад

    This was incredibly helpful. Thank you!

  • @OfisLab
    @OfisLab 2 года назад

    thank man, this really helped clarify these concepts

  • @MrSkaterview
    @MrSkaterview 2 года назад

    Simple and concise. Thank you so much

  • @ariannagold4599
    @ariannagold4599 Год назад

    You're the best. Much love from Miami U.

  • @azizas9366
    @azizas9366 3 года назад

    Now it is clear. Thanks for posting this video.

  • @SuperKiingg
    @SuperKiingg 2 года назад

    great job very straight and clear tutorial, thank you

  • @joepetey
    @joepetey 3 года назад +3

    Thanks! Very useful how to use Having instead of 'where' , helped me count a column then use a condition to check the count greater then a value.

  • @aasiralikhan7205
    @aasiralikhan7205 2 года назад

    Very easily explained! Big thanks!!

  • @veezyp
    @veezyp 4 года назад

    Best explanation I have come across. Thanks

  • @ygp47
    @ygp47 5 месяцев назад

    Such a simple and powerful explanation video

  • @marwaawad3677
    @marwaawad3677 2 месяца назад

    it helped alot thank you for short and clear explnation

  • @johnbarratt2042
    @johnbarratt2042 Год назад

    FANTASTIC! Thank you!!!!

  • @kadekhendradarmasastrawan7694
    @kadekhendradarmasastrawan7694 6 месяцев назад

    Just found this video and it's really helpful

  • @enriqueperez4082
    @enriqueperez4082 2 года назад

    Thank you! This was great help!!!

  • @moviemagg3096
    @moviemagg3096 7 месяцев назад

    Thank you, well explained! Subscribed!

  • @beatricebass9245
    @beatricebass9245 3 года назад

    Great video! Very helpful and made a ton of sense! Thanks!!

  • @Mona-gh3mh
    @Mona-gh3mh 2 года назад

    Your video is great! Helps me a lot!!!

  • @simmyjer
    @simmyjer Год назад

    Very helpful. Thank you!

  • @jettecantoria
    @jettecantoria Год назад

    Thank you. This is so helpful.

  • @bevedel
    @bevedel Год назад

    short and helpful. Thank you.

  • @michealangelodelacruz7740
    @michealangelodelacruz7740 8 месяцев назад

    Clear and concise! Great and very informative videos!

  • @mrreese2342
    @mrreese2342 7 месяцев назад

    i love how this guy in 6 minutes managed to explain GROUP BY and HAVING whilst i've been struggling with them for the whole semester

  • @xplorer3001
    @xplorer3001 27 дней назад

    clear and easy to understand !

  • @christianyaksic3555
    @christianyaksic3555 3 года назад

    It couldn't be clearer. Thank you!

  • @itsReshad
    @itsReshad 2 года назад

    Good Video, explained it very well, I was stuck with the silliest problem and because of the way you explained it I sorted the issue! Top Video my friend!

  • @karlkarnu7641
    @karlkarnu7641 Год назад

    Great video, thanks!

  • @ericakillz2052
    @ericakillz2052 3 месяца назад

    Oh my god, you helped me so much I spent all day on this and you helped me more than the damn instructor did. Thank you so much.

  • @ProbabilityVsRule
    @ProbabilityVsRule Год назад

    Thank you. It helps me so much.

  • @saifulislam-qf8xj
    @saifulislam-qf8xj 3 года назад

    THANK YOU!! I sorted easily

  • @Misfittykitty
    @Misfittykitty Год назад

    Thank you so much you are a GREAT teacher! :)

  • @migelvandevoorde9593
    @migelvandevoorde9593 3 года назад

    This was really helpful, thank you!!!!

  • @TheFranzKranz
    @TheFranzKranz 2 года назад

    Thx it really helped me understand the HAVING and WHERE Statement

  • @originalkaylah
    @originalkaylah 5 месяцев назад

    im so happy I found this video!!😆

  • @tanveerulhaq6511
    @tanveerulhaq6511 3 года назад

    Great explanation. Thank you so much...

  • @evcaliz
    @evcaliz 2 года назад

    You are an amazing teacher

  • @user-iz2kv6xq5n
    @user-iz2kv6xq5n 10 месяцев назад

    Very helpful, you are a great teacher!!

  • @juliakristavilladiego4425
    @juliakristavilladiego4425 3 года назад

    Thank you so much. Really helpful!

  • @JC-ej1xi
    @JC-ej1xi 8 месяцев назад

    This is super helpful. Thank you.

  • @ugonnac8937
    @ugonnac8937 2 года назад

    This was very helpful and well explained. Thanks

  • @ivankljun2542
    @ivankljun2542 3 года назад

    Great explanation, thanks!

  • @Runa_Nura
    @Runa_Nura Год назад

    nice content, easy to understand.
    THX

  • @dmoneyballa
    @dmoneyballa 3 года назад

    this was really helpful watched this after getting a hacker rank question where I had to stack overflow too much.

  • @bubblebath2892
    @bubblebath2892 6 месяцев назад

    Brilliant vid man , thnaks a ton

  • @dblacwell
    @dblacwell 2 года назад

    I learned everything I needed to know !

  • @thulanidendere3986
    @thulanidendere3986 2 года назад

    ... thanks man, you just made my life easier 👌

  • @IntricateMoon
    @IntricateMoon Год назад

    Thank you for this!!!

  • @camilopinzon5957
    @camilopinzon5957 3 года назад

    Great Job, thanks for sharing Knowledge.

  • @Valivalia777
    @Valivalia777 3 года назад +1

    Thanks for the video and your examples, you can really explain it in simple words, nice work :)))))