← Back to Aggregates & GROUP BY
Question 5
Students With a Posted GPA
Students With a Posted GPA
Three students have nogpayet (it is NULL until their first grades are posted). Return one row with three columns:all_students(every row, viaCOUNT(*)),with_gpa(only rows wheregpais not NULL, viaCOUNT(gpa)) andwithout_gpa(the difference between the two).
Expected result:
+--------------+----------+-------------+ | all_students | with_gpa | without_gpa | +--------------+----------+-------------+ | 30 | 27 | 3 | +--------------+----------+-------------+ 1 row
Hints3 available
Sign in to use hintsTopics:
Aggregates & GROUP BY
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)
Results
Run your SQL to see every statement's output here, then how it compares with the expected answer.
Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.