I am trying to do the exercise:
Challenge: Khan Academy Report Card
But I'm not finding my way around it. What I have to do is group by grades but I only count the total.
My question is the following:
SELECT COUNT(*),
CASE
WHEN number_grade > 90 THEN "A"
WHEN number_grade > 80 THEN "B"
WHEN number_grade > 70 THEN "C"
ELSE "F"
END AS letter_grade
FROM student_grades
ORDER BY letter_grade;
And what I get is all the aggregated data (and they should be able to disaggregate it by grade: A, B, C and F)
In this link Challenge: report card are the other queries and the rest of the database.
Thank you!
The solution was that I made a mistake and instead of using GROUP BY, I used ORDER BY.
Correct answer: