ChallengeĀ¶
Pleased with your progress so far, your supervisor at Woodcreek College shared your work with colleagues, which went down really well š! Perhaps too well, as your supervisor is back with a new set of requests from the team :slight_frown:.
Let's get stuck in!
Skipped Part 1?
We recommend doing the problem Beginner > Woodcreek College Exam Results before trying this one, but if you're keen to press on anyway then you must download our
Student_Results_Combined
in BigQuery.
Recall the Student_Results_Combined
table we created in the precursor problem Beginner > Woodcreek College Exam Results1..
This time, your supervisor wants you to report pass rate - the percentage of students who passed their exam. A student passed their exam if they scored at least 60.
Your supervisor requests to see pass rates by
- (Gender, Year_group) pairs and
- (Gender) and
- All students combined
...in the same report šµāš«.
The pass rate must also be formatted to one decimal place and should include the % sign in the results for readability.
Expected Result
Hint
You'll need to use an uncommon addition to the GROUP BY
clause for this called ROLLUP
. This is key for producing the rolled up pass rates. You'll need to use a sub-query to re-format the null values generated by ROLLUP
SolutionĀ¶
Footnotes
-
Dataset Source: http://roycekimmons.com/ ā©