← Back to SELECT Basics
Question 30
Grades Below 60
Grades Below 60
Fromenrollments, returnstudent_id,course_idandgradefor every row whosegradeis below 60, lowest grade first, using an explicitASC. Rows whosegradeis still NULL, because the course is in progress or was dropped, are not below 60 as far as SQL is concerned, so they do not appear.
Expected result:
+------------+-----------+-------+ | student_id | course_id | grade | +------------+-----------+-------+ | 26 | 9 | 45 | | 26 | 5 | 51 | | 12 | 1 | 52 | | 16 | 5 | 55 | | 22 | 11 | 57 | | 12 | 4 | 58 | | 24 | 5 | 59 | +------------+-----------+-------+ 7 rows
Hints3 available
Sign in to use hintsTopics:
SELECT Basics
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.