I am referring to this question: https://www.codecademy.com/paths/design-databases-with-postgresql/tracks/what-can-i-do-with-a-database/modules/querying-baseball-data-off-platform-project/informationals/off-platform-project-baseball-through-the-years
I am on Part-4, where you have to create your own award, I chose one of the examples given, ‘the Canadian Ace’, which is where you need to find the players with the lowest ERA (earned point average) whose stadium is in Canada. My query seems to work (would love if someone more experienced can give it a look and see if it can be improved):
MIN(pitching.era) AS era_player,
ON pitching.playerid = people.playerid
ON teams.teamid = pitching.teamid
ON parks.parkname = teams.park
WHERE parks.country = ‘CA’
AND pitching.era > 0
GROUP BY people.namegiven, pitching.yearid, teams.name, parks.parkname, parks.country
ORDER BY 2 ASC;
I am not sure if I even need to SELECT the picthing.yearid column?
There were also some ERAs of 0, was that supposed to be included and is considered to be 'better and thus lower than the ones mentioned din my query?
Please see if there is anything wrong with this query. Thank you!