Загрузка...

SQL Aggregate Functions, GROUP BY, and HAVING — Explained Clearly

SQL Aggregate Functions, GROUP BY, and HAVING — Explained Clearly

In this video, we take a deep and practical look at SQL aggregate functions, including how and why they work, and how to use them correctly with GROUP BY and HAVING.

Many learners struggle when SQL shifts from returning rows to summarizing data. This tutorial is designed to slow things down, explain the why, and help you build the correct mental model.

🔍 What You’ll Learn
- What aggregate functions are — and how they differ from row-level functions
- The standard ANSI SQL aggregate functions:
- MIN(), MAX(), COUNT(), SUM(), AVG()
- How NULL values affect aggregate results
- The difference between COUNT(*) and COUNT(column)
- Why GROUP BY is required and how it works
- Common GROUP BY mistakes (and how to fix them)
- Why SQL behaves differently across database platforms
- How and when to use the HAVING clause
- The difference between WHERE and HAVING
- How SQL processes queries in stages

🧪 Hands-On Demo
We use:
- MySQL
- DBeaver (free database tool)
- All SQL scripts used in this video are linked in the comments so you can follow along step by step.

DB Scripts:
- https://github.com/saipanman95/sql-aggregates-demo-scripts

You are welcome to use any SQL tool or database you are comfortable with.

🧠 Key Takeaway
Once you understand WHERE, GROUP BY, and HAVING as three separate stages, aggregate queries become much easier to read, write, and debug.

💬 Join the Conversation
- If you made it to the end of the video, leave a comment:
- “I get it now!” — if it finally clicked
- Or “Not yet” — and let me know where you’re stuck
-
👍 Like • Subscribe • Bell
If this video helped you:
- Like the video
- Subscribe to the channel
- Click the bell so you don’t miss future SQL tutorials

Thanks for watching — I’ll see you in the next one.

Видео SQL Aggregate Functions, GROUP BY, and HAVING — Explained Clearly канала CWM - Coding With Mike
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять