Test Scores
You are working in the admissions department at a university,
tasked with analyzing the standardized test scores (SAT and ACT) of the applicants.
The applicants' test scores are in sat_scores
and act_scores
.
column_name | type |
---|---|
id | VARCHAR |
student_id | VARCHAR |
math_score | INTEGER |
reading_score | INTEGER |
column_name | type |
---|---|
id | VARCHAR |
student_id | VARCHAR |
math_score | INTEGER |
english_score | INTEGER |
reading_score | INTEGER |
science_score | INTEGER |
The total SAT score is out of 1600 possible points consisting of the sum of two 800-point sections. The total ACT score is out of 36 possible points consisting of the average of four 36-point sections. Each of the sections is a separate column in their respective tables.
Between the 2 exams, their score range is totally different. Some applicants have only taken the SAT, and some have only taken the ACT. We need a way to combine the scores and compare across exams, i.e. did some who got 29/36 on the ACT do better than someone who got 1300/1600 on the SAT? For that we'll use a normalized score call the z-score.
The z-score is a scale-independent way to represent the values in a distribution. It is like the concept of "grading on a curve," where everyone's grade is determined in comparison to the population instead of their absolute number. To convert each score to its corresponding z-score, first you need the average and the standard deviation of the population's scores. Each z-score (z) is calculated by subtracting the average (µ) from the raw score (x) and then dividing by the standard deviation (σ).
For example, if the SAT has an average score of 1050 and a standard deviation of 150,
someone who with a raw score of 1200 has a z-score equal to (1200 - 1050) / 150
which is 1.33
.
For this challenge, convert both the SAT and ACT scores to their corresponding z-scores,
then UNION
them together into a single table, making sure the following columns are present:
id
- The ID of the test result.student_id
- The ID of the student who took the test.raw_score
- The overall test result score.normalized_score
- The z-score.test
- Whether the result is for the SAT or ACT. This value should be either the string'SAT'
or'ACT'
.
Don't worry about computing the standard deviation from scratch. There are functions to help you out!