Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: List the duration, file size and format of songs whose genre is pop, ordered by title? [/INST]

Output: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_name;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What is the duration, file size, and song format for every pop song, ordered by title alphabetically? [/INST]

Output: SELECT T1.duration ,  T1.file_size ,  T1.formats FROM files AS T1 JOIN song AS T2 ON T1.f_id  =  T2.f_id WHERE T2.genre_is  =  "pop" ORDER BY T2.song_name;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names of the artists who have produced English songs but have never received rating higher than 8. [/INST]

Output: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  8;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the different artists that have produced a song in English but have never receieved a rating higher than 8? [/INST]

Output: SELECT DISTINCT artist_name FROM song WHERE languages  =  "english" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  8;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: Find the names of the artists who are from Bangladesh and have never received rating higher than 7. [/INST]

Output: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7;


Input:
[INST] Here is a database schema:
genre :
g_name [ TEXT ] primary_key
rating [ TEXT ]
most_popular_in [ TEXT ]

artist :
artist_name [ TEXT ] primary_key
country [ TEXT ]
gender [ TEXT ]
preferred_genre [ TEXT ] artist.preferred_genre = genre.g_name

files :
f_id [ INT ] primary_key
artist_name [ TEXT ] files.artist_name = artist.artist_name
file_size [ TEXT ]
duration [ TEXT ]
formats [ TEXT ]

song :
song_name [ TEXT ] primary_key
artist_name [ TEXT ] song.artist_name = artist.artist_name
country [ TEXT ]
f_id [ INT ] song.f_id = files.f_id
genre_is [ TEXT ] song.genre_is = genre.g_name
rating [ INT ]
languages [ TEXT ]
releasedate [ TEXT ]
resolution [ INT ]

Please write me a SQL statement that answers the following question: What are the names of the different artists from Bangladesh who never received a rating higher than a 7? [/INST]

Output: SELECT DISTINCT artist_name FROM artist WHERE country  =  "Bangladesh" EXCEPT SELECT DISTINCT artist_name FROM song WHERE rating  >  7;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: what is the full name and id of the college with the largest number of baseball players? [/INST]

Output: SELECT T1.name_full ,  T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id  =  T2.college_id GROUP BY T1.college_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: Find the full name and id of the college that has the most baseball players. [/INST]

Output: SELECT T1.name_full ,  T1.college_id FROM college AS T1 JOIN player_college AS T2 ON T1.college_id  =  T2.college_id GROUP BY T1.college_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: What is average salary of the players in the team named 'Boston Red Stockings' ? [/INST]

Output: SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings';


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: Compute the average salary of the players in the team called 'Boston Red Stockings'. [/INST]

Output: SELECT avg(T1.salary) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings';


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: What are first and last names of players participating in all star game in 1998? [/INST]

Output: SELECT name_first ,  name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id WHERE YEAR  =  1998;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: List the first and last name for players who participated in all star game in 1998. [/INST]

Output: SELECT name_first ,  name_last FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id WHERE YEAR  =  1998;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: What are the first name, last name and id of the player with the most all star game experiences? Also list the count. [/INST]

Output: SELECT T1.name_first , T1.name_last ,  T1.player_id ,   count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: Which player has the most all star game experiences? Give me the first name, last name and id of the player, as well as the number of times the player participated in all star game. [/INST]

Output: SELECT T1.name_first , T1.name_last ,  T1.player_id ,   count(*) FROM player AS T1 JOIN all_star AS T2 ON T1.player_id  =  T2.player_id GROUP BY T1.player_id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: How many players enter hall of fame each year? [/INST]

Output: SELECT yearid ,  count(*) FROM hall_of_fame GROUP BY yearid;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: Count the number of players who enter hall of fame for each year. [/INST]

Output: SELECT yearid ,  count(*) FROM hall_of_fame GROUP BY yearid;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: What is the average number of attendance at home games for each year? [/INST]

Output: SELECT YEAR ,  avg(attendance) FROM home_game GROUP BY YEAR;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: For each year, return the year and the average number of attendance at home games. [/INST]

Output: SELECT YEAR ,  avg(attendance) FROM home_game GROUP BY YEAR;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: In 2014, what are the id and rank of the team that has the largest average number of attendance? [/INST]

Output: SELECT T2.team_id ,  T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id WHERE T1.year  =  2014 GROUP BY T1.team_id ORDER BY avg(T1.attendance) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
all_star :
player_id [ TEXT ] all_star.player_id = player.player_id
year [ INT ]
game_num [ INT ]
game_id [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
gp [ INT ]
starting_pos [ INT ]

appearances :
year [ INT ]
team_id [ TEXT ] appearances.team_id = team.team_id
league_id [ TEXT ]
player_id [ TEXT ] appearances.player_id = player.player_id
g_all [ INT ]
gs [ INT ]
g_batting [ INT ]
g_defense [ INT ]
g_p [ INT ]
g_c [ INT ]
g_1b [ INT ]
g_2b [ INT ]
g_3b [ INT ]
g_ss [ INT ]
g_lf [ INT ]
g_cf [ INT ]
g_rf [ INT ]
g_of [ INT ]
g_dh [ INT ]
g_ph [ INT ]
g_pr [ INT ]

manager_award :
player_id [ TEXT ] manager_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ INT ]

player_award :
player_id [ TEXT ] player_award.player_id = player.player_id
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
tie [ TEXT ]
notes [ TEXT ]

manager_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ]
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

player_award_vote :
award_id [ TEXT ]
year [ INT ]
league_id [ TEXT ]
player_id [ TEXT ] player_award_vote.player_id = player.player_id
points_won [ INT ]
points_max [ INT ]
votes_first [ INT ]

batting :
player_id [ TEXT ] batting.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

batting_postseason :
year [ INT ]
round [ TEXT ]
player_id [ TEXT ] batting_postseason.player_id = player.player_id
team_id [ TEXT ] batting_postseason.team_id = team.team_id
league_id [ TEXT ]
g [ INT ]
ab [ INT ]
r [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
rbi [ INT ]
sb [ INT ]
cs [ INT ]
bb [ INT ]
so [ INT ]
ibb [ INT ]
hbp [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

player_college :
player_id [ TEXT ] player_college.player_id = player.player_id
college_id [ TEXT ] player_college.college_id = college.college_id
year [ INT ]

fielding :
player_id [ TEXT ] fielding.player_id = player.player_id
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
pb [ INT ]
wp [ INT ]
sb [ INT ]
cs [ INT ]
zr [ INT ]

fielding_outfield :
player_id [ TEXT ] fielding_outfield.player_id = player.player_id
year [ INT ]
stint [ INT ]
glf [ INT ]
gcf [ INT ]
grf [ INT ]

fielding_postseason :
player_id [ TEXT ] fielding_postseason.player_id = player.player_id
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
round [ TEXT ]
pos [ TEXT ]
g [ INT ]
gs [ INT ]
inn_outs [ INT ]
po [ INT ]
a [ INT ]
e [ INT ]
dp [ INT ]
tp [ INT ]
pb [ INT ]
sb [ INT ]
cs [ INT ]

hall_of_fame :
player_id [ TEXT ] hall_of_fame.player_id = player.player_id
yearid [ INT ]
votedby [ TEXT ]
ballots [ INT ]
needed [ INT ]
votes [ INT ]
inducted [ TEXT ]
category [ TEXT ]
needed_note [ TEXT ]

home_game :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ] home_game.team_id = team.team_id
park_id [ TEXT ] home_game.park_id = park.park_id
span_first [ TEXT ]
span_last [ TEXT ]
games [ INT ]
openings [ INT ]
attendance [ INT ]

manager :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]
plyr_mgr [ TEXT ]

manager_half :
player_id [ TEXT ]
year [ INT ]
team_id [ TEXT ] manager_half.team_id = team.team_id
league_id [ TEXT ]
inseason [ INT ]
half [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]
rank [ INT ]

player :
player_id [ TEXT ]
birth_year [ INT ]
birth_month [ INT ]
birth_day [ INT ]
birth_country [ TEXT ]
birth_state [ TEXT ]
birth_city [ TEXT ]
death_year [ INT ]
death_month [ INT ]
death_day [ INT ]
death_country [ TEXT ]
death_state [ TEXT ]
death_city [ TEXT ]
name_first [ TEXT ]
name_last [ TEXT ]
name_given [ TEXT ]
weight [ INT ]
height [ INT ]
bats [ TEXT ]
throws [ TEXT ]
debut [ TEXT ]
final_game [ TEXT ]
retro_id [ TEXT ]
bbref_id [ TEXT ]

park :
park_id [ TEXT ]
park_name [ TEXT ]
park_alias [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

pitching :
player_id [ TEXT ]
year [ INT ]
stint [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ INT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

pitching_postseason :
player_id [ TEXT ]
year [ INT ]
round [ TEXT ]
team_id [ TEXT ]
league_id [ TEXT ]
w [ INT ]
l [ INT ]
g [ INT ]
gs [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
h [ INT ]
er [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
baopp [ TEXT ]
era [ INT ]
ibb [ INT ]
wp [ INT ]
hbp [ INT ]
bk [ INT ]
bfp [ INT ]
gf [ INT ]
r [ INT ]
sh [ INT ]
sf [ INT ]
g_idp [ INT ]

salary :
year [ INT ]
team_id [ TEXT ]
league_id [ TEXT ]
player_id [ TEXT ]
salary [ INT ]

college :
college_id [ TEXT ]
name_full [ TEXT ]
city [ TEXT ]
state [ TEXT ]
country [ TEXT ]

postseason :
year [ INT ]
round [ TEXT ]
team_id_winner [ TEXT ]
league_id_winner [ TEXT ]
team_id_loser [ TEXT ]
league_id_loser [ TEXT ]
wins [ INT ]
losses [ INT ]
ties [ INT ]

team :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
franchise_id [ TEXT ]
div_id [ TEXT ]
rank [ INT ]
g [ INT ]
ghome [ INT ]
w [ INT ]
l [ INT ]
div_win [ TEXT ]
wc_win [ TEXT ]
lg_win [ TEXT ]
ws_win [ TEXT ]
r [ INT ]
ab [ INT ]
h [ INT ]
double [ INT ]
triple [ INT ]
hr [ INT ]
bb [ INT ]
so [ INT ]
sb [ INT ]
cs [ INT ]
hbp [ INT ]
sf [ INT ]
ra [ INT ]
er [ INT ]
era [ INT ]
cg [ INT ]
sho [ INT ]
sv [ INT ]
ipouts [ INT ]
ha [ INT ]
hra [ INT ]
bba [ INT ]
soa [ INT ]
e [ INT ]
dp [ INT ]
fp [ INT ]
name [ TEXT ]
park [ TEXT ]
attendance [ INT ]
bpf [ INT ]
ppf [ INT ]
team_id_br [ TEXT ]
team_id_lahman45 [ TEXT ]
team_id_retro [ TEXT ]

team_franchise :
franchise_id [ TEXT ]
franchise_name [ TEXT ]
active [ TEXT ]
na_assoc [ TEXT ]

team_half :
year [ INT ]
league_id [ TEXT ]
team_id [ TEXT ]
half [ INT ]
div_id [ TEXT ]
div_win [ TEXT ]
rank [ INT ]
g [ INT ]
w [ INT ]
l [ INT ]

Please write me a SQL statement that answers the following question: Find the id and rank of the team that has the highest average attendance rate in 2014. [/INST]

Output: SELECT T2.team_id ,  T2.rank FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id WHERE T1.year  =  2014 GROUP BY T1.team_id ORDER BY avg(T1.attendance) DESC LIMIT 1;