CJCoding With Joseph
15free / daySign inCreate account

Grades Below 60

From enrollments, return student_id, course_id and grade for every row whose grade is below 60, lowest grade first, using an explicit ASC. Rows whose grade is 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
Topics:
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.