My question concerns queries to select leaders (playerID) in various baseball categories on a yearly basis. In other words, I want a listing of the player or players who had the MAX number of home runs (HR) in 1901, 1902.... These need to be separated by league (AL or NL)
TABLE: Batting
Fields: playerID, year, team, league, HR (examples: aarohe001/1963/ATL/NL/44)..among other categories
One complication is that a player may be played for two or more teams in any given season would have separate listings for each team for that season, which means that I would need to sum each player's stats for every season.
A further complication is that the traded player may have switched leagues, in which case I don't want to sum his yearly totals.
Secondly, I would like to be able to expand this query to return a player's rank in the top team by year and league in a category.
By way of explanation, there are a couple of rough estimators when looking at a player's Hall of Fame potential, the Black-Ink Test and the Gray-Ink Test. The first awards points for leading the league in certain categories and the second recognizes the fact that some don't lead the league but place highly year after year.
I don't write SQL, using Access 2007's Query Design Too instead, but I can use SQL.
TABLE: Batting
Fields: playerID, year, team, league, HR (examples: aarohe001/1963/ATL/NL/44)..among other categories
One complication is that a player may be played for two or more teams in any given season would have separate listings for each team for that season, which means that I would need to sum each player's stats for every season.
A further complication is that the traded player may have switched leagues, in which case I don't want to sum his yearly totals.
Secondly, I would like to be able to expand this query to return a player's rank in the top team by year and league in a category.
By way of explanation, there are a couple of rough estimators when looking at a player's Hall of Fame potential, the Black-Ink Test and the Gray-Ink Test. The first awards points for leading the league in certain categories and the second recognizes the fact that some don't lead the league but place highly year after year.
I don't write SQL, using Access 2007's Query Design Too instead, but I can use SQL.
Last edited: