Fake Apps question 3


Hi, I'm working on the Fake Apps SQL project and I'm not sure if I got the 'best' answer for question 3. This is my answer:

SELECT name, category, max(downloads) from fake_apps;

I'm not sure if there is a way of selecting just name and category and filtering for the app with the highest number of downloads without getting downloads to appear as a column. Can someone show me the answer that would do what I just described?


The idea is to count how many apps of each kind you have (example: books, 8). You're not looking for any information pertaining to the downloads.

Instead of looking at MAX(downloads) try COUNT().

Hope this helps and is right, I also struggled with this one.

EDIT: Just realized I think you meant task 4, which I am stuck with the same issue as you. Sorry!


SELECT name, category FROM fake_apps
WHERE downloads = (SELECT MAX(downloads) FROM fake_apps);

That's the right desicion.


This is correct. You need to use the COUNT() function rather than the SUM() or MAX() functions:
SELECT category, COUNT(*) FROM fake_apps GROUP BY category;


i came to the same conclusion for this question but it does not work.

SELECT category, COUNT(*) FROM fake_apps ORDER BY category;

that does not display the number of apps in each category although i believe it should.

my code must be wrong somewhere


You are close, try using a different argument instead of ORDER BY. Remember that what we are trying to accomplish is to group the items (total fake apps) by category.


Thank you @brotherhelmer for pointing that out. i already got some help point me in the same direction :smiley:

Cheers bud