Database: baseball_1

Question: What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?
SQL: SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;

Question: How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?
SQL: SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first  =  'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;

Question: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
SQL: SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'

Question: How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?
SQL: SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;

Question: Which team had the least number of attendances in home games in 1980?
SQL: SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;

Question: List the names of states that have more than 2 parks.
SQL: SELECT state FROM park GROUP BY state HAVING count(*)  >  2;

Question: Which cities have 2 to 4 parks?
SQL: SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;