SAT in the NYC borough, was the performance good enough?
Tags: sql, python, analytics
Published: 2022-06-20 06:57:18

The SAT (Scholastic Aptitude Test) exam is essential to get data points for each student who wants to continue their tertiary study. A person's SAT score, literacy, numeracy, and writing competencies can be measured as a consideration of whether they are worthy of being accepted by a university or not. The score range of each part of the exam is 200 - 800.

Because many universities consider this score necessary, many students take this test to go through the selection process for new student admissions. One of them is in New York state. Does each area have the same SAT score with the division of five boroughs? Let's analyze it using the data available in the database.

Given that our data is still available in a database let's drag using the SQL language in a notebook.


## 1. We have to connect right
In making a connector in the database, it is necessary to use the function available in mysql.connector, then adjust the available arguments to the database to be inputted. In this case, the database name is a school that uses the root account on the local host.

![Connector](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apube18i0xf996c81cn3.png)
 
After that, make the first query to display the available table characteristics.

![Table Describe](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/im608vdxxzqsn9aetowz.png)
 

## 2. Viewing the top 10 data
Our school table contains several columns that define the average SAT score for each school in each NYC borough. The top ten data held are as follows:

![Top 10 data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ouiotszp5uqfqqsj5k9u.png)
 
Let's also check whether the table we have contains empty values ​​or not.

![Check Missing Value](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnm48suy8stitzclzq4q.png)
 
Fortunately, each column in the table has its value.


## 3. Math, which school is the best?
Numerical ability is a crucial thing that can be used as a benchmark for someone to be accepted into a university or not. Let's see which school has students with the highest average math scores compared to other schools based on quartiles using Paging in SQL.

![Best Math score](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qm6hcy5p9mzefpyeufpq.png)
 
Stuyvesant High School is the best, with an average math score of 754, which is quite different from second place with 40 points!



## 4. Don't forget about literacy and writing!
Let's see how low NYC students are in the reading aspect first.

![Minimum reading score](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dly2ynwrxgog90qh2mx8.png)
 
A score of 302 is a reasonably low average for a country like New York. Then, what about the current authorship score?

![Best writing score](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9flqpk9ri2kx1afrwde.png)
 
Again the same school! We should examine the overall SAT score average at each NYC school.


##5. Let's give it a ranking!
The available schools also need to be seen whether they have the same average score as Stuyvesant High School.

![Rank school](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0qum1lhf33ys44tpsey.png)
 
It turns out that there are only four schools that have an overall SAT score average that exceeds 2000. Then we can determine which borough of New York City has the best average SAT score.


## 6. Which NYC Borough is the best?
Of the five available boroughs, the distribution of the number of schools and the average inevitably SAT score is uneven. Let's see now!

![Borough Ranking](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j3zxl0nvuodrmsy49dye.png)

We can see that the Staten Island area has a reasonably high average overall SAT score compared to other boroughs. However, there are only ten schools in this area. To close this analysis, we will choose a school in the borough of Brooklyn which has 109 schools but with the best average score in mathematics.

## 7. Best school for mathematicians in Brooklyn
You can use this method to see which school will be the best place in the average SAT math score.

![Mathematicians in Brooklyn](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ub6yob46zinlxjg6nmzg.png)

Ok, next month, Brooklyn Technical High School will be an excellent place for someone aspiring to be a mathematician.