▸_sqlgym

45. Grade Distribution By Class

MediumAggregationGROUP BY multiple columnsCOUNT

Grouping by multiple columns makes one group per distinct combination of those columns.

Task: for each (class, grade) pair, return how many students earned that grade.

Return columns class, grade, students. Order by class ascending, then grade ascending.

Tables
Loading schema…
Expected outputrows must come back in this order
Computing expected output…

This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases 5test cases in all. A sloppy query that only fits the example won't pass.

SQL
⌘/Ctrl+↵ run · ⇧⌘/Ctrl+↵ submit
Run a query to see its output here.