Here, we'll take a look at SAT across public schools in New York City.
Data had one table and 6 columns as seen in the Schema. The data type is also specified.
Inspecting the data
We used the SELECT
to find all the records FROM
the schools_modified data. Then limited it to the first 10 to just give a preview of the data
The first row had an empty column let's find out the missing values
We found that there were 20 missing values in the perecent_tested category.
What is the minimum average reading score? Without an Alias, the column name(result) gets a default value
We find which school was best performing in maths. By using ORDER BY
We can arrange our query by adding DESC
makes it from highest to lowest.
We can find the average score by grouping the information by school name. Remember any statement in the SELECT
statement and not in the aggregate should be included in the GROUP BY
clause. The function would still work even without an ORDER BY
but would give results not as exactly as we would have anticipated. Check the difference between the two tables below
We can use the WHERE
clause to find values within a specified category.
Here, LIKE
is used in the WHERE
clause this will return all values like Brooklyn. Incasevalues could be having cases that have not been standardized then ILIKE
would work.
We have used the above project to revise the basic statements used in SQL.
If you'd wish to get the data for your practice too I'll upload it on GitHub.
vamos a practicar