1. Find out how many games that each baseball team won in 2015.
Your result should have 30 rows
2. Find the years in which the Chicago Cubs won at least 95 games.
Your result should have 7 rows.
3. Find the statistics for how many home runs that Ernie Banks hit
with a year-by-year breakdown, while he was playing
for the Chicago Cubs.
FYI, Ernie Banks was awarded the Presidential Medal of Freedom
in 2013, for his contribution to sports.
Your result should have 19 rows
4. Identify each player who hit 40 or more home runs during a year,
while they were playing with the Chicago Cubs.
Your result should have 18 rows, and some
players achieved such an accomplishment several times (and will
therefore appear in the list multiple times).
5. Have there been any Chicago Cubs players to
get 100 or more runs in a single season?
Find all such Cubs players who had such an achievement since 2000.
6. Find, for each year since 1960, how many Chicago Cubs players
there were in each year. Your result should have 56 rows.
7. Find the player who had the largest number of doubles in one season.
# Hint for questions 8, 9, 10:
# You might need/want to use "HAVING" near the end of your query on each question.
8. Find the teams and years in which a team
won at least 105 games that year.
Your result should have 18 rows.
Notice that some players achieved this feat during more than 1 season.
9. Find the breakdown of players who had 500 or more home runs during
their lifetime. Your result should have 26 rows.
10. Just like we adjusted the data type and the indexing for
some of the batting, master, and teams tables,
please go ahead and adjust the data types and indexing in
the pitching table as follows:
alter table pitching modify playerID varchar(20);
alter table pitching modify teamID varchar(20);
We should also build an index for each of these fields, as follows:
alter table pitching add index pitching_playerID(playerID);
alter table pitching add index pitching_teamID(teamID);
Now find the pitchers who have made
at least 3000 strikeouts during their career.
Your result should have 16 rows.