← Back to Subqueries
Question 110
Course Fees Beside the Average
Course Fees Beside the Average
For each course running in'Winter 2026', show its fee next to the average fee of all 14 courses. Returncode,feeandavg_fee(the college-wide average rounded to 2 decimals, so the same value on every row). Sort bycode. Use a subquery in the column list, not a join.
Expected result:
+---------+-----+---------+ | code | fee | avg_fee | +---------+-----+---------+ | BIO305 | 780 | 649.29 | | BUS320 | 900 | 649.29 | | CS201 | 650 | 649.29 | | CS230 | 700 | 649.29 | | CS350 | 820 | 649.29 | | ENG250 | 450 | 649.29 | | MATH220 | 600 | 649.29 | +---------+-----+---------+ 7 rows
Hints3 available
Sign in to use hintsTopics:
Subqueries
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.