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

preview_player
Показать описание
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!

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

Support the Channel:
Рекомендации по теме
Комментарии
Автор

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

Subscribed ❤️

talalbow
Автор

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!

gustavshochat
Автор

These are amazing tutorials. Keep up the great work!

hankbreckenridge
Автор

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

eecolme
Автор

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

Mori-Chan
Автор

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 ❤️

rungxanh
Автор

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.

sarahemslie
Автор

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.

goinggoinggone
Автор

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

colevarney
Автор

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

majeyork
Автор

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

VishalPatel-lyuq
Автор

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

SD-vjrr
Автор

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

FaktzTV
Автор

Thank you for sorting this out so clearly!

sarahfinley
Автор

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

mskafridi
Автор

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

topazdazzlesDA
Автор

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!

faiqahaider
Автор

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

bth
Автор

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

COOKINGBIRD
Автор

thank man, this really helped clarify these concepts

OfisLab