← Back to Aggregates & GROUP BY
Question 14
Courses Per Semester and Level
Courses Per Semester and Level
Break the course catalogue down by term and year level. Returnsemester,level,courses(how many courses share that pair) andtotal_credits(theSUMof theircredits), one row per combination that actually occurs, sorted bysemesterand thenlevel.
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
Sign in to use hintsTopics:
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.