CJCoding With Joseph
15free / daySign inCreate account

Busiest Courses First

Count the enrollments in each course. Return code and enrollments (the count), with the busiest course first: sort by enrollments descending, then by code to break ties. Only courses with at least one enrollment appear, so ART140 is missing.

Expected result:

+---------+-------------+
| code    | enrollments |
+---------+-------------+
| MATH110 |          14 |
| ENG101  |          12 |
| CS230   |          11 |
| BUS150  |          10 |
| CS101   |          10 |
| CS201   |           6 |
| MATH220 |           6 |
| BIO120  |           5 |
| BIO305  |           4 |
| CS310   |           4 |
+---------+-------------+
(showing 10 of 13 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.