From the course: Complete Guide to SQL for Data Engineering: from Beginner to Advanced

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Using GROUP BY to aggregate data

Using GROUP BY to aggregate data

- [Instructor] Imagine you are hosting a party and you have got a list of items you have bought, for example, sodas, chip cupcakes and so on along with their quantities and cost. Using Group By, you could quickly summarize your spending by item category, helping you manage your budgets more effectively. Let's understand Group By. Group By statements groups the rows that have the same values into the summary rows like find the number of customer in each country. It helps you to categorize the data. For example, in your dataset of let's say, the product dataset. Now, in this product dataset, if you have product belongs to every category, now you want to identify one category has how many number of items. Then probably what you can do is you can group by this product table based on the category. Or maybe let's take another example. Let's say we have a cover customer data. Now our customer belongs to the various cities…

Contents