# FAQ: Aggregate Functions - Group By I

This community-built FAQ covers the “Group By I” exercise from the lesson “Aggregate Functions”.

Paths and Courses
This exercise can be found in the following Codecademy content:

## Join the Discussion. Help a fellow learner on their journey.

Agree with a comment or answer? Like () to up-vote the contribution!

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

If we were to not use the GROUP BY clause such as

FROM fake_apps;

The program returns 1 row with with the News in the category and the sum of the downloads in the other column.

But why does it select News as the category? It is not the min, max, mode, or avg.

4 Likes

Just wanto to bump this question as I had the exact some one in mind coming here. I think understanding this is fundamental to understanding how SQL works/its logic for organizing queries.

In the context of this exercise, why should we type an * inside the COUNT( ) function? Does it make any difference?

SELECT price, COUNT(*)
FROM fake_apps
GROUP BY price;

1 Like

@ justin976629
I believe it selects News because it is the category with the fewest letters.

Hi guys,

I have a question regarding the following exercise GROUP BY I.
I was struggling with the second task and the exercise was only completed when the solution was found for the third task which was a bit confusing. Please advise about the second question as I couldn’t find any solution with WHERE clause which works.

1. In the code editor, type:

SELECT price, COUNT(*)
FROM fake_apps
GROUP BY price;

1. In the previous query, add a WHERE clause to count the total number of apps that have been downloaded more than 20,000 times, at each price.

2. Remove the previous query. Write a new query that calculates the total number of downloads for each category.

SELECT category,

FROM fake_apps

GROUP BY category;

You need to perform filtering with WHERE before the GROUP BY clause. The hint for that question notes this. It’s probably worth looking up execution order for sql anyway as it makes a few things clearer if you’re unfamiliar with it.