CJCoding With Joseph
15free / daySign inCreate account

Courses Per Semester and Level

Break the course catalogue down by term and year level. Return semester, level, courses (how many courses share that pair) and total_credits (the SUM of their credits), one row per combination that actually occurs, sorted by semester and then level.

Expected result:

+-------------+-------+---------+---------------+
| semester    | level | courses | total_credits |
+-------------+-------+---------+---------------+
| Fall 2025   |   100 |       6 |            19 |
| Fall 2025   |   300 |       1 |             4 |
| Winter 2026 |   200 |       4 |            12 |
| Winter 2026 |   300 |       3 |             9 |
+-------------+-------+---------+---------------+
4 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.