Filtering grades based on city avg, in SQL
Question
Given the following table, called 'students', write a SQL query to count the # of students with grades above the Detroit average.
age | city | grade | name | |
---|---|---|---|---|
0 | 20 | Detroit | 88 | Willard Morris |
1 | 19 | Detroit | 95 | Al Jennings |
2 | 22 | New York | 92 | Omar Mullins |
3 | 21 | San Francisco | 70 | Spencer McDaniel |