CREATE TABLE all_star (
    player_id TEXT,
    year NUMBER,
    game_num NUMBER,
    game_id TEXT,
    team_id TEXT,
    league_id TEXT,
    gp NUMBER,
    starting_pos NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE appearances (
    year NUMBER,
    team_id TEXT,
    league_id TEXT,
    player_id TEXT,
    g_all NUMBER,
    gs NUMBER,
    g_batting NUMBER,
    g_defense NUMBER,
    g_p NUMBER,
    g_c NUMBER,
    g_1b NUMBER,
    g_2b NUMBER,
    g_3b NUMBER,
    g_ss NUMBER,
    g_lf NUMBER,
    g_cf NUMBER,
    g_rf NUMBER,
    g_of NUMBER,
    g_dh NUMBER,
    g_ph NUMBER,
    g_pr NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id"),
    FOREIGN KEY ("team_id") REFERENCES team("team_id")
);
CREATE TABLE manager_award (
    player_id TEXT,
    award_id TEXT,
    year NUMBER,
    league_id TEXT,
    tie TEXT,
    notes NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE player_award (
    player_id TEXT,
    award_id TEXT,
    year NUMBER,
    league_id TEXT,
    tie TEXT,
    notes TEXT,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE manager_award_vote (
    award_id TEXT,
    year NUMBER,
    league_id TEXT,
    player_id TEXT,
    points_won NUMBER,
    points_max NUMBER,
    votes_first NUMBER
);
CREATE TABLE player_award_vote (
    award_id TEXT,
    year NUMBER,
    league_id TEXT,
    player_id TEXT,
    points_won NUMBER,
    points_max NUMBER,
    votes_first NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE batting (
    player_id TEXT,
    year NUMBER,
    stint NUMBER,
    team_id TEXT,
    league_id TEXT,
    g NUMBER,
    ab NUMBER,
    r NUMBER,
    h NUMBER,
    double NUMBER,
    triple NUMBER,
    hr NUMBER,
    rbi NUMBER,
    sb NUMBER,
    cs NUMBER,
    bb NUMBER,
    so NUMBER,
    ibb NUMBER,
    hbp NUMBER,
    sh NUMBER,
    sf NUMBER,
    g_idp NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE batting_postseason (
    year NUMBER,
    round TEXT,
    player_id TEXT,
    team_id TEXT,
    league_id TEXT,
    g NUMBER,
    ab NUMBER,
    r NUMBER,
    h NUMBER,
    double NUMBER,
    triple NUMBER,
    hr NUMBER,
    rbi NUMBER,
    sb NUMBER,
    cs NUMBER,
    bb NUMBER,
    so NUMBER,
    ibb NUMBER,
    hbp NUMBER,
    sh NUMBER,
    sf NUMBER,
    g_idp NUMBER,
    FOREIGN KEY ("team_id") REFERENCES team("team_id"),
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE player_college (
    player_id TEXT,
    college_id TEXT,
    year NUMBER,
    FOREIGN KEY ("college_id") REFERENCES college("college_id"),
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE fielding (
    player_id TEXT,
    year NUMBER,
    stint NUMBER,
    team_id TEXT,
    league_id TEXT,
    pos TEXT,
    g NUMBER,
    gs NUMBER,
    inn_outs NUMBER,
    po NUMBER,
    a NUMBER,
    e NUMBER,
    dp NUMBER,
    pb NUMBER,
    wp NUMBER,
    sb NUMBER,
    cs NUMBER,
    zr NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE fielding_outfield (
    player_id TEXT,
    year NUMBER,
    stint NUMBER,
    glf NUMBER,
    gcf NUMBER,
    grf NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE fielding_postseason (
    player_id TEXT,
    year NUMBER,
    team_id TEXT,
    league_id TEXT,
    round TEXT,
    pos TEXT,
    g NUMBER,
    gs NUMBER,
    inn_outs NUMBER,
    po NUMBER,
    a NUMBER,
    e NUMBER,
    dp NUMBER,
    tp NUMBER,
    pb NUMBER,
    sb NUMBER,
    cs NUMBER,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE hall_of_fame (
    player_id TEXT,
    yearid NUMBER,
    votedby TEXT,
    ballots NUMBER,
    needed NUMBER,
    votes NUMBER,
    inducted TEXT,
    category TEXT,
    needed_note TEXT,
    FOREIGN KEY ("player_id") REFERENCES player("player_id")
);
CREATE TABLE home_game (
 

Question: List players' first name and last name who have weight greater than 220 or height shorter than 75.
SQL: SELECT name_first ,  name_last FROM player WHERE weight  >  220 OR height  <  75

Question: What are the first name and last name of the players who have weight above 220 or height below 75?
SQL: SELECT name_first ,  name_last FROM player WHERE weight  >  220 OR height  <  75

Question: List the maximum scores of the team Boston Red Stockings when the team won in postseason?
SQL: SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings';

Question: What are the maximum scores the team Boston Red Stockings got when the team won in postseason?
SQL: SELECT max(T1.wins) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings';

Question: How many times did Boston Red Stockings lose in 2009 postseason?
SQL: SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year = 2009;

Question: Count the number of times the team "Boston Red Stockings" lost in 2009 postseason.
SQL: SELECT count(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year = 2009;

Question: What are the name and id of the team with the most victories in 2008 postseason?
SQL: SELECT T2.name ,  T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T1.year  =  2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;

Question: Find the name and id of the team that won the most times in 2008 postseason.
SQL: SELECT T2.name ,  T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T1.year  =  2008 GROUP BY T1.team_id_winner ORDER BY count(*) DESC LIMIT 1;

Question: What is the number of wins the team Boston Red Stockings got in the postseasons each year in history?
SQL: SELECT count(*) ,  T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' GROUP BY T1.year

Question: For each year, return the year and the number of times the team Boston Red Stockings won in the postseasons.
SQL: SELECT count(*) ,  T1.year FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' GROUP BY T1.year

Question: What is the total number of postseason games that team Boston Red Stockings participated in?
SQL: SELECT count(*) FROM ( SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' );

Question: How many times in total did the team Boston Red Stockings participate in postseason games?
SQL: SELECT count(*) FROM ( SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' UNION SELECT * FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_loser  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' );

Question: How many games in 1885 postseason resulted in ties (that is, the value of "ties" is '1')?
SQL: SELECT count(*) FROM postseason WHERE YEAR  =  1885 AND ties  =  1;

Question: Find the number of tied games (the value of "ties" is '1') in 1885 postseason.
SQL: SELECT count(*) FROM postseason WHERE YEAR  =  1885 AND ties  =  1;

Question: What is the total salary paid by team Boston Red Stockings in 2010?
SQL: SELECT sum(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2010