Why does this query work and this does not? (beginner)


#1

EXERCISE: GROUP BY II/AGGREGATE FUNCTIONS no.8/DATA SCIENCE (PYTHON)
Does anyone know by any chance why this works:

SELECT category,
price,
AVG(downloads)
FROM fake_apps
GROUP BY 1,2;

But does not work if I put it like:

SELECT category, price AVG(downloads)
FROM fake_apps
GROUP BY 1,2;

Thank you everyone for your help!


#2

The language used in this exercise is actually SQL, rather than Python.

The problem with the second query is that a comma is missing after price on this line …

SELECT category, price AVG(downloads)