chat_prompt
stringlengths 438
1.53k
|
|---|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: What was the average number of \"goals for\", scored in the club Real Oviedo that had a \"goal difference\" lower than -16 and fewer than 9 wins?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"goals_for\") FROM \"final_table\" WHERE \"goal_difference\"<-16 AND \"club\"='real oviedo' AND \"wins\"<9;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: How many people played at the club that had a \"goal difference\" of -8 and a position lower than 12?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"played\") FROM \"final_table\" WHERE \"goal_difference\"=-8 AND \"position\"<12;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: How many \"goals against\" were scored at the club that had a \"goal difference\" of 0, 12 wins, and more than 44 goals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"goals_against\") FROM \"final_table\" WHERE \"goal_difference\"=0 AND \"wins\"=12 AND \"goals_for\">44;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: What is the smallest number of \"goals for\" out of the clubs where there were 18 wins and fewer than 38 \"goals against\"?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"goals_for\") FROM \"final_table\" WHERE \"wins\"=18 AND \"goals_against\"<38;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_winners\" (\n \"year\" real,\n \"fighter\" text,\n \"nation_represented\" text,\n \"sport\" text,\n \"sanctioning_body_or_league\" text,\n \"weight_class_represented_or_contested\" text\n);\n\nQuestion: When did Manny Pacquiao win his first championship?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"list_of_winners\" WHERE \"fighter\"='manny pacquiao';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_winners\" (\n \"year\" real,\n \"fighter\" text,\n \"nation_represented\" text,\n \"sport\" text,\n \"sanctioning_body_or_league\" text,\n \"weight_class_represented_or_contested\" text\n);\n\nQuestion: Which sport did the United States win?"
},
{
"role": "assistant",
"content": "SELECT \"sport\" FROM \"list_of_winners\" WHERE \"nation_represented\"='united states';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_winners\" (\n \"year\" real,\n \"fighter\" text,\n \"nation_represented\" text,\n \"sport\" text,\n \"sanctioning_body_or_league\" text,\n \"weight_class_represented_or_contested\" text\n);\n\nQuestion: What is the latest result where a person from the Philippines won?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"list_of_winners\" WHERE \"nation_represented\"='philippines';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_winners\" (\n \"year\" real,\n \"fighter\" text,\n \"nation_represented\" text,\n \"sport\" text,\n \"sanctioning_body_or_league\" text,\n \"weight_class_represented_or_contested\" text\n);\n\nQuestion: Which nation won the boxing championship in 2012?"
},
{
"role": "assistant",
"content": "SELECT \"nation_represented\" FROM \"list_of_winners\" WHERE \"year\"=2012;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"party\" text,\n \"party_list_votes\" real,\n \"vote_percentage\" text,\n \"total_seats\" text,\n \"seat_percentage\" text\n);\n\nQuestion: What is the total number of seats of the Christian Democratic Union (CDU) party?"
},
{
"role": "assistant",
"content": "SELECT \"total_seats\" FROM \"results\" WHERE \"party\"='christian democratic union (cdu)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"results\" (\n \"party\" text,\n \"party_list_votes\" real,\n \"vote_percentage\" text,\n \"total_seats\" text,\n \"seat_percentage\" text\n);\n\nQuestion: What seat has a vote percentage of 100.0%"
},
{
"role": "assistant",
"content": "SELECT \"seat_percentage\" FROM \"results\" WHERE \"vote_percentage\"='100.0%';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"name\" text,\n \"population_2011\" real,\n \"population_2006\" real,\n \"change_pct\" real,\n \"area_km\" real,\n \"population_density\" real\n);\n\nQuestion: What was the area in Glenella with a population of 522 in 2011?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"area_km\") FROM \"list\" WHERE \"name\"='glenella' AND \"population_2011\"<522;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list\" (\n \"name\" text,\n \"population_2011\" real,\n \"population_2006\" real,\n \"change_pct\" real,\n \"area_km\" real,\n \"population_density\" real\n);\n\nQuestion: What is the population density of Siglunes when the change was smaller than -8.1 percent?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"population_density\") FROM \"list\" WHERE \"name\"='siglunes' AND \"change_pct\"<-8.1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners_of_the_virginia_derby_since_1998\" (\n \"year\" real,\n \"winner\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text,\n \"distance_miles\" text,\n \"time\" text\n);\n\nQuestion: Who was the trainer when Crowd Pleaser won?"
},
{
"role": "assistant",
"content": "SELECT \"trainer\" FROM \"winners_of_the_virginia_derby_since_1998\" WHERE \"winner\"='crowd pleaser';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners_of_the_virginia_derby_since_1998\" (\n \"year\" real,\n \"winner\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text,\n \"distance_miles\" text,\n \"time\" text\n);\n\nQuestion: What was the race time of the horse with jockey Ramon Dominguez?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"winners_of_the_virginia_derby_since_1998\" WHERE \"jockey\"='ramon dominguez';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners_of_the_virginia_derby_since_1998\" (\n \"year\" real,\n \"winner\" text,\n \"jockey\" text,\n \"trainer\" text,\n \"owner\" text,\n \"distance_miles\" text,\n \"time\" text\n);\n\nQuestion: What jockey rode for Michael House before 2012"
},
{
"role": "assistant",
"content": "SELECT \"jockey\" FROM \"winners_of_the_virginia_derby_since_1998\" WHERE \"year\"<2012 AND \"owner\"='michael house';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"contestants\" (\n \"name\" text,\n \"from\" text,\n \"discipline\" text,\n \"events_won_uk_series\" real,\n \"events_won_us_series\" real\n);\n\nQuestion: How many UK events won for the contestant that won under 1 US event?"
},
{
"role": "assistant",
"content": "SELECT \"events_won_uk_series\" FROM \"contestants\" WHERE \"events_won_us_series\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"contestants\" (\n \"name\" text,\n \"from\" text,\n \"discipline\" text,\n \"events_won_uk_series\" real,\n \"events_won_us_series\" real\n);\n\nQuestion: How many US events did jason bennett win?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"events_won_us_series\") FROM \"contestants\" WHERE \"name\"='jason bennett';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_standings\" (\n \"season\" real,\n \"overall\" text,\n \"slalom\" text,\n \"giant_slalom\" text,\n \"super_g\" text,\n \"downhill\" text,\n \"combined\" text\n);\n\nQuestion: Which downhill has 7 overalls?"
},
{
"role": "assistant",
"content": "SELECT \"downhill\" FROM \"season_standings\" WHERE \"overall\"='7';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_standings\" (\n \"season\" real,\n \"overall\" text,\n \"slalom\" text,\n \"giant_slalom\" text,\n \"super_g\" text,\n \"downhill\" text,\n \"combined\" text\n);\n\nQuestion: What super g was before 1998, had 2 giant slaloms and 24 downhills?"
},
{
"role": "assistant",
"content": "SELECT \"super_g\" FROM \"season_standings\" WHERE \"season\"<1998 AND \"giant_slalom\"='2' AND \"downhill\"='24';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_standings\" (\n \"season\" real,\n \"overall\" text,\n \"slalom\" text,\n \"giant_slalom\" text,\n \"super_g\" text,\n \"downhill\" text,\n \"combined\" text\n);\n\nQuestion: What is the combined of 2 overalls and 5 slaloms?"
},
{
"role": "assistant",
"content": "SELECT \"combined\" FROM \"season_standings\" WHERE \"overall\"='2' AND \"slalom\"='5';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_standings\" (\n \"season\" real,\n \"overall\" text,\n \"slalom\" text,\n \"giant_slalom\" text,\n \"super_g\" text,\n \"downhill\" text,\n \"combined\" text\n);\n\nQuestion: How many overalls has 1 combined and 24 downhills?"
},
{
"role": "assistant",
"content": "SELECT \"overall\" FROM \"season_standings\" WHERE \"combined\"='1' AND \"downhill\"='24';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stage_results\" (\n \"date\" text,\n \"course\" text,\n \"distance\" text,\n \"winner\" text,\n \"race_leader\" text\n);\n\nQuestion: What Distance had a Race Leader in Km (mi)?"
},
{
"role": "assistant",
"content": "SELECT \"distance\" FROM \"stage_results\" WHERE \"race_leader\"='km (mi)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_by_season_record\" (\n \"season\" text,\n \"games\" real,\n \"lost\" real,\n \"tied\" text,\n \"points\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"standing\" text\n);\n\nQuestion: What is the highest number of points scored when Acadie-Bathurst had 4 tied games, less than 257 goals, and over 72 games played?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"points\") FROM \"season_by_season_record\" WHERE \"tied\"='4' AND \"goals_for\"<257 AND \"games\">72;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rugby_wales_internationals_1987\" (\n \"first_game\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"percentage\" text\n);\n\nQuestion: What is the average of games played with a percentage of 3.33% and less than 29 losses?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"played\") FROM \"rugby_wales_internationals_1987\" WHERE \"percentage\"='3.33%' AND \"lost\"<29;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rugby_wales_internationals_1987\" (\n \"first_game\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"percentage\" text\n);\n\nQuestion: What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"played\") FROM \"rugby_wales_internationals_1987\" WHERE \"first_game\"=1991 AND \"percentage\"='22.22%' AND \"lost\">7;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rugby_wales_internationals_1987\" (\n \"first_game\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"percentage\" text\n);\n\nQuestion: What is the highest number of draws that correlates with a percentage of 0.00% and less than 1 loss?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"drawn\") FROM \"rugby_wales_internationals_1987\" WHERE \"percentage\"='0.00%' AND \"lost\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: What is the start value for rank 11?"
},
{
"role": "assistant",
"content": "SELECT \"start\" FROM \"indy_500_results\" WHERE \"rank\"='11';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: Which year has 200 laps?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"indy_500_results\" WHERE \"laps\"=200;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"indy_500_results\" (\n \"year\" text,\n \"start\" text,\n \"qual\" text,\n \"rank\" text,\n \"finish\" text,\n \"laps\" real\n);\n\nQuestion: What is the finish value for a start of 19?"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"indy_500_results\" WHERE \"start\"='19';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director\" text\n);\n\nQuestion: What country is the film directed by Alfonso Cuar\u00f3n from?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"2000s\" WHERE \"director\"='alfonso cuar\u00f3n';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director\" text\n);\n\nQuestion: What is the original title of the film directed by Cristian Mungiu?"
},
{
"role": "assistant",
"content": "SELECT \"original_title\" FROM \"2000s\" WHERE \"director\"='cristian mungiu';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director\" text\n);\n\nQuestion: What country is the film directed by Michael Haneke from?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"2000s\" WHERE \"director\"='michael haneke';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director\" text\n);\n\nQuestion: What is the English title of the film from after 2003 directed by Michael Haneke?"
},
{
"role": "assistant",
"content": "SELECT \"english_title\" FROM \"2000s\" WHERE \"year\">2003 AND \"director\"='michael haneke';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"team\" text,\n \"city\" text,\n \"stadium\" text,\n \"manager\" text,\n \"past_season\" text\n);\n\nQuestion: where is the naghsh jahan stadium?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"teams\" WHERE \"stadium\"='naghsh jahan';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"team\" text,\n \"city\" text,\n \"stadium\" text,\n \"manager\" text,\n \"past_season\" text\n);\n\nQuestion: what city has a past season of n/a?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"teams\" WHERE \"past_season\"='n/a';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"team\" text,\n \"city\" text,\n \"stadium\" text,\n \"manager\" text,\n \"past_season\" text\n);\n\nQuestion: where is the pegah team located?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"teams\" WHERE \"team\"='pegah';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"teams\" (\n \"team\" text,\n \"city\" text,\n \"stadium\" text,\n \"manager\" text,\n \"past_season\" text\n);\n\nQuestion: what stadium has a prior record of 7th?"
},
{
"role": "assistant",
"content": "SELECT \"stadium\" FROM \"teams\" WHERE \"past_season\"='7th';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat\" real,\n \"lane\" real,\n \"name\" text,\n \"nationality\" text,\n \"time\" text\n);\n\nQuestion: What is the Nationality on the swimmer in Lane 4 with a Time of 1:11.58?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"heats\" WHERE \"lane\"=4 AND \"time\"='1:11.58';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat\" real,\n \"lane\" real,\n \"name\" text,\n \"nationality\" text,\n \"time\" text\n);\n\nQuestion: What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"lane\") FROM \"heats\" WHERE \"heat\">2 AND \"time\"='1:10.57';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat\" real,\n \"lane\" real,\n \"name\" text,\n \"nationality\" text,\n \"time\" text\n);\n\nQuestion: What is the Heat for Smiljana Marinovi\u0107?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"heat\") FROM \"heats\" WHERE \"name\"='smiljana marinovi\u0107';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat\" real,\n \"lane\" real,\n \"name\" text,\n \"nationality\" text,\n \"time\" text\n);\n\nQuestion: In heat 4, what is Byun Hye-young's Nationality?"
},
{
"role": "assistant",
"content": "SELECT \"nationality\" FROM \"heats\" WHERE \"heat\"=4 AND \"name\"='byun hye-young';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"songs\" (\n \"number\" real,\n \"name_of_the_song\" text,\n \"singer\" text,\n \"drama\" text,\n \"kind_of_the_song\" text\n);\n\nQuestion: Which type of song did miriam yeung sing?"
},
{
"role": "assistant",
"content": "SELECT \"kind_of_the_song\" FROM \"songs\" WHERE \"singer\"='miriam yeung';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"songs\" (\n \"number\" real,\n \"name_of_the_song\" text,\n \"singer\" text,\n \"drama\" text,\n \"kind_of_the_song\" text\n);\n\nQuestion: What type of song is larger than 8 and named \u5be6\u60c5?"
},
{
"role": "assistant",
"content": "SELECT \"kind_of_the_song\" FROM \"songs\" WHERE \"number\">8 AND \"name_of_the_song\"='\u5be6\u60c5';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"songs\" (\n \"number\" real,\n \"name_of_the_song\" text,\n \"singer\" text,\n \"drama\" text,\n \"kind_of_the_song\" text\n);\n\nQuestion: Which song has a ending theme, and is sung by miriam yeung?"
},
{
"role": "assistant",
"content": "SELECT \"name_of_the_song\" FROM \"songs\" WHERE \"kind_of_the_song\"='ending theme' AND \"singer\"='miriam yeung';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"songs\" (\n \"number\" real,\n \"name_of_the_song\" text,\n \"singer\" text,\n \"drama\" text,\n \"kind_of_the_song\" text\n);\n\nQuestion: What is the number of the song named \u5be6\u60c5?"
},
{
"role": "assistant",
"content": "SELECT \"number\" FROM \"songs\" WHERE \"name_of_the_song\"='\u5be6\u60c5';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the total number of start when finish is less than 4"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"start\") FROM \"daytona_500_results\" WHERE \"finish\"<4;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the sum of year when start is less than 30"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"daytona_500_results\" WHERE \"start\"<30;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the most year with start more than 2"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"daytona_500_results\" WHERE \"start\">2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the most year with start less than 2"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"daytona_500_results\" WHERE \"start\"<2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the year when start was 32"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"daytona_500_results\" WHERE \"start\"=32;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"daytona_500_results\" (\n \"year\" real,\n \"manufacturer\" text,\n \"start\" real,\n \"finish\" real,\n \"team\" text\n);\n\nQuestion: Name the most finish for 2006"
},
{
"role": "assistant",
"content": "SELECT MAX(\"finish\") FROM \"daytona_500_results\" WHERE \"year\"=2006;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"february\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What was the total attendance at games when Detroit was the visiting team and the record was 36\u201313\u20135?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"february\" WHERE \"visitor\"='detroit' AND \"record\"='36\u201313\u20135';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: When did first minister Henry Mcleish enter office?"
},
{
"role": "assistant",
"content": "SELECT \"entered_office\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"first_minister\"='henry mcleish';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: What is the name of the minister that left office on 14 November 2006?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"left_office\"='14 november 2006';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: What is the name of the minister from the party of minister for community safety and legal affairs?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"party\"='minister for community safety and legal affairs';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: What is the name of the minister who has an entered office of entered office?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"entered_office\"='entered office';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: What is the party of the minister who left office on 26 November 2002?"
},
{
"role": "assistant",
"content": "SELECT \"party\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"left_office\"='26 november 2002';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"minister_for_community_safety_and_legal_\" (\n \"name\" text,\n \"entered_office\" text,\n \"left_office\" text,\n \"party\" text,\n \"first_minister\" text\n);\n\nQuestion: What is the party of Richard Simpson?"
},
{
"role": "assistant",
"content": "SELECT \"party\" FROM \"minister_for_community_safety_and_legal_\" WHERE \"name\"='richard simpson';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"turkish_national_team\" (\n \"date\" text,\n \"time_cest\" real,\n \"team_num1\" text,\n \"res\" text,\n \"team_num2\" text,\n \"round\" text,\n \"spectators\" real\n);\n\nQuestion: Name the sum of spectators for time more than 20.05 and team #2 of estonia"
},
{
"role": "assistant",
"content": "SELECT SUM(\"spectators\") FROM \"turkish_national_team\" WHERE \"time_cest\">20.05 AND \"team_num2\"='estonia';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"turkish_national_team\" (\n \"date\" text,\n \"time_cest\" real,\n \"team_num1\" text,\n \"res\" text,\n \"team_num2\" text,\n \"round\" text,\n \"spectators\" real\n);\n\nQuestion: Name the spectators for 11 november 2011"
},
{
"role": "assistant",
"content": "SELECT \"spectators\" FROM \"turkish_national_team\" WHERE \"date\"='11 november 2011';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: Which loss has a Record of 54-39?"
},
{
"role": "assistant",
"content": "SELECT \"loss\" FROM \"game_log\" WHERE \"record\"='54-39';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: Which opponent has a Record of 54-38?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='54-38';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: Which opponent has a date of July 7?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='july 7';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: Which record has a Loss of eichhorn (8-5)?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"loss\"='eichhorn (8-5)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"november\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real\n);\n\nQuestion: What is the average attendance San Jose home games?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"attendance\") FROM \"november\" WHERE \"home\"='san jose';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"november\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real\n);\n\nQuestion: Who was the attendance at the game attended by 18,118 with a visiting team of Nashville?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"november\" WHERE \"attendance\">'18,118' AND \"visitor\"='nashville';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the record at the game that had a loss of Spillner (1-8)?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"loss\"='spillner (1-8)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the score of the game that had a loss of Williams (1-1)?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"loss\"='williams (1-1)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the loss of the game that had a record of 63-52?"
},
{
"role": "assistant",
"content": "SELECT \"loss\" FROM \"game_log\" WHERE \"record\"='63-52';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What was the score when the Washington Nationals had a record of 11-10?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"record\"='11-10';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Who was the opponent when the Washington Nationals had a record of 8-4?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='8-4';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: How many people were in attendance when the Washington Nationals had a score of 7-3 and a loss of Worrell (0-1)?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"attendance\") FROM \"game_log\" WHERE \"score\"='7-3' AND \"loss\"='worrell (0-1)';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_results\" (\n \"name\" text,\n \"team\" text,\n \"qual_1\" text,\n \"qual_2\" text,\n \"best\" text\n);\n\nQuestion: Name the Qual 2 which has the name of katherine legge"
},
{
"role": "assistant",
"content": "SELECT \"qual_2\" FROM \"qualifying_results\" WHERE \"name\"='katherine legge';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_results\" (\n \"name\" text,\n \"team\" text,\n \"qual_1\" text,\n \"qual_2\" text,\n \"best\" text\n);\n\nQuestion: Name the team with best of 58.846"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"qualifying_results\" WHERE \"best\"='58.846';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_results\" (\n \"name\" text,\n \"team\" text,\n \"qual_1\" text,\n \"qual_2\" text,\n \"best\" text\n);\n\nQuestion: Tell me the name with best of 58.403"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"qualifying_results\" WHERE \"best\"='58.403';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"qualifying_results\" (\n \"name\" text,\n \"team\" text,\n \"qual_1\" text,\n \"qual_2\" text,\n \"best\" text\n);\n\nQuestion: Tell me the qual 1 for jan heylen"
},
{
"role": "assistant",
"content": "SELECT \"qual_1\" FROM \"qualifying_results\" WHERE \"name\"='jan heylen';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: When the attendance was 24,406 who lost?"
},
{
"role": "assistant",
"content": "SELECT \"loss\" FROM \"game_log\" WHERE \"attendance\"='24,406';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Which of the opponents has a record of 17-25?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='17-25';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who was the opponent that played on may 12?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='may 12';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_league\" (\n \"date\" text,\n \"opponents\" text,\n \"result_f_a\" text,\n \"attendance\" real,\n \"league_position\" text\n);\n\nQuestion: When in the 1st league position, how many people watch as they faced West Ham United?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"premier_league\" WHERE \"league_position\"='1st' AND \"opponents\"='west ham united';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_league\" (\n \"date\" text,\n \"opponents\" text,\n \"result_f_a\" text,\n \"attendance\" real,\n \"league_position\" text\n);\n\nQuestion: What was the result with West Ham United with more than 67,577 in attendance?"
},
{
"role": "assistant",
"content": "SELECT \"result_f_a\" FROM \"premier_league\" WHERE \"attendance\">'67,577' AND \"opponents\"='west ham united';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"bronze\") FROM \"medals_table\" WHERE \"nation\"='uganda' AND \"total\">2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medals_table\" (\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the highest number of silver medals that Ireland earned when they scored less than 3 bronze medals and earned 1 medal?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"silver\") FROM \"medals_table\" WHERE \"bronze\"<3 AND \"gold\"<1 AND \"total\"=1 AND \"nation\"='ireland';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"total\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the highest silver and 1 gold that the nation of djibouti received with a total less than 3?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"silver\") FROM \"total\" WHERE \"gold\"=1 AND \"nation\"='djibouti' AND \"total\"<3;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"total\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the total number that had a rank larger than 17 and a gold greater than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"total\" WHERE \"rank\">17 AND \"gold\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: Which opponent was faced before week 2?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"week\"<2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Name the least total for 1978 years won"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"made_the_cut\" WHERE \"year_s_won\"='1978';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Name the total with finish of t22"
},
{
"role": "assistant",
"content": "SELECT \"total\" FROM \"made_the_cut\" WHERE \"finish\"='t22';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Name the average total for years won of 1975"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"made_the_cut\" WHERE \"year_s_won\"='1975';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Name the finish with player lou graham"
},
{
"role": "assistant",
"content": "SELECT \"finish\" FROM \"made_the_cut\" WHERE \"player\"='lou graham';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Name the total number of total with finish of t45"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"made_the_cut\" WHERE \"finish\"='t45';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" text,\n \"position\" text,\n \"league\" text,\n \"fa_cup\" text,\n \"malaysia_cup\" text\n);\n\nQuestion: What year was the League the malaysian super league, and a Malaysia Cup of group stage?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"achievements\" WHERE \"league\"='malaysian super league' AND \"malaysia_cup\"='group stage';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" text,\n \"position\" text,\n \"league\" text,\n \"fa_cup\" text,\n \"malaysia_cup\" text\n);\n\nQuestion: What is the position when the League is the malaysian super league, and a Year of 2011?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"achievements\" WHERE \"league\"='malaysian super league' AND \"year\"='2011';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" text,\n \"position\" text,\n \"league\" text,\n \"fa_cup\" text,\n \"malaysia_cup\" text\n);\n\nQuestion: What year was the position 6/13?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"achievements\" WHERE \"position\"='6/13';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" text,\n \"position\" text,\n \"league\" text,\n \"fa_cup\" text,\n \"malaysia_cup\" text\n);\n\nQuestion: What year was the League of malaysian super league, and the Position was 10/14?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"achievements\" WHERE \"league\"='malaysian super league' AND \"position\"='10/14';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_wairarapa_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: tell me the average roll for the featherston area and integrated authority."
},
{
"role": "assistant",
"content": "SELECT AVG(\"roll\") FROM \"south_wairarapa_district\" WHERE \"area\"='featherston' AND \"authority\"='integrated';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_wairarapa_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: tell me the authority that has a decile less than 6 and roll less than 65."
},
{
"role": "assistant",
"content": "SELECT \"authority\" FROM \"south_wairarapa_district\" WHERE \"decile\"<6 AND \"roll\"<65;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_wairarapa_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: tell me the average roll for pirinoa school."
},
{
"role": "assistant",
"content": "SELECT AVG(\"roll\") FROM \"south_wairarapa_district\" WHERE \"name\"='pirinoa school';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_wairarapa_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: tell me the total number of decile with a roll showing 251."
},
{
"role": "assistant",
"content": "SELECT COUNT(\"decile\") FROM \"south_wairarapa_district\" WHERE \"roll\"=251;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"external_links\" (\n \"year\" real,\n \"champion\" text,\n \"score\" text,\n \"defeated\" text,\n \"location\" text\n);\n\nQuestion: What is the score for 2004?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"external_links\" WHERE \"year\"=2004;"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.