Fake Apps Questions 13 & 14


#1

For Question 13 I've typed:

select category, count(downloads) from fake_apps where category = 'music';

My query results are 0 (zero). I know that this is the work answer because when I do a query where I group downloads by category I get a different number.

What am I doing wrong?

select category, count(downloads) from fake_apps where category = 'music';

#2

Hi !
You actually have two errors :
- first, you obtain 0 as a result for a very simple fact : you should write 'Music' with a capital letter and not 'music' (there is no category called 'music' as it is case-sensitive).
- second, if you type this :

select category, count(downloads) from fake_apps where category = 'Music';

you will obtain 8 as a result.

Be careful with :
count() function that returns how many apps are in the music category.
sum() function that returns the sum of all the downloads in the music category.

So the right code should be :

SELECT category,  SUM(downloads)
FROM fake_apps
WHERE category = 'Music';