CJCoding With Joseph
15free / daySign inCreate account

Courses Averaging Above 80

Find the courses whose average posted grade is above 80. Return code, graded (how many enrollments in the course have a non-NULL grade) and avg_grade (the average grade, rounded to 2 decimal places), sorted by avg_grade descending. AVG already skips NULL grades, so the in-progress and dropped rows need no WHERE; the cut-off must be tested after grouping.

Expected result:

+---------+--------+-----------+
| code    | graded | avg_grade |
+---------+--------+-----------+
| MATH220 |      1 |        95 |
| ENG101  |     10 |      81.6 |
+---------+--------+-----------+
2 rows
Hints3 available
Topics:
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.