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 \"multiple_medalists\" (\n \"athlete_nation\" text,\n \"olympics\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest medal total with less than 3 gold medals?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"multiple_medalists\" WHERE \"gold\"<3;"
}
] |
[
{
"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's the lowest amount of laps with a start of 21?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"laps\") FROM \"indy_500_results\" WHERE \"start\"='21';"
}
] |
[
{
"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 was the start of the competitor with a qualifying time of 84.300?"
},
{
"role": "assistant",
"content": "SELECT \"start\" FROM \"indy_500_results\" WHERE \"qual\"='84.300';"
}
] |
[
{
"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: In what year were there more laps than 200 in a race?"
},
{
"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 \"nintendo_64\" (\n \"name\" text,\n \"current_version\" text,\n \"system\" text,\n \"platform\" text,\n \"license\" text\n);\n\nQuestion: what is the current version of the project64 with gpl v2 license?"
},
{
"role": "assistant",
"content": "SELECT \"current_version\" FROM \"nintendo_64\" WHERE \"license\"='gpl v2' AND \"name\"='project64';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nintendo_64\" (\n \"name\" text,\n \"current_version\" text,\n \"system\" text,\n \"platform\" text,\n \"license\" text\n);\n\nQuestion: what is the current version of the name mupen64plus with gpl v2 license?"
},
{
"role": "assistant",
"content": "SELECT \"current_version\" FROM \"nintendo_64\" WHERE \"license\"='gpl v2' AND \"name\"='mupen64plus';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nintendo_64\" (\n \"name\" text,\n \"current_version\" text,\n \"system\" text,\n \"platform\" text,\n \"license\" text\n);\n\nQuestion: what is the current version with license gpl v3?"
},
{
"role": "assistant",
"content": "SELECT \"current_version\" FROM \"nintendo_64\" WHERE \"license\"='gpl v3';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What leading man earlier than 1932 was directed by archie mayo?"
},
{
"role": "assistant",
"content": "SELECT \"leading_man\" FROM \"films\" WHERE \"year\"<1932 AND \"director\"='archie mayo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What year was the role nan taylor, alias of nan ellis, aka mrs. andrews and directed by William keighley?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"films\" WHERE \"role\"='nan taylor, alias of nan ellis, aka mrs. andrews' AND \"director\"='william keighley';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What is the latest year for the role of joan gordon, aka francine la rue?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"films\" WHERE \"role\"='joan gordon, aka francine la rue';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What film has a leading man of adolphe menjou in 1939?"
},
{
"role": "assistant",
"content": "SELECT \"film\" FROM \"films\" WHERE \"leading_man\"='adolphe menjou' AND \"year\"=1939;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What film was the director william a. wellman, later than 1931 with a leading man of george brent, and a Role of joan gordon, aka francine la rue?"
},
{
"role": "assistant",
"content": "SELECT \"film\" FROM \"films\" WHERE \"director\"='william a. wellman' AND \"year\">1931 AND \"leading_man\"='george brent' AND \"role\"='joan gordon, aka francine la rue';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"films\" (\n \"year\" real,\n \"film\" text,\n \"role\" text,\n \"leading_man\" text,\n \"director\" text\n);\n\nQuestion: What director directed the role of shelby barret wyatt in 1935?"
},
{
"role": "assistant",
"content": "SELECT \"director\" FROM \"films\" WHERE \"year\"=1935 AND \"role\"='shelby barret wyatt';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ratings\" (\n \"air_date\" text,\n \"timeslot_est\" text,\n \"season\" text,\n \"rating\" real,\n \"share\" real,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: What is the weekly rank for a share of 9 and 9.42 million viewers?"
},
{
"role": "assistant",
"content": "SELECT \"weekly_rank_num\" FROM \"ratings\" WHERE \"share\"=9 AND \"viewers_m\"=9.42;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ratings\" (\n \"air_date\" text,\n \"timeslot_est\" text,\n \"season\" text,\n \"rating\" real,\n \"share\" real,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: What is the sum of all ratings at a weekly rank of 10 and a share less than 11?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rating\") FROM \"ratings\" WHERE \"weekly_rank_num\"='10' AND \"share\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ratings\" (\n \"air_date\" text,\n \"timeslot_est\" text,\n \"season\" text,\n \"rating\" real,\n \"share\" real,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: What is the highest number of viewers for a rating greater than 9.4?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"viewers_m\") FROM \"ratings\" WHERE \"rating\">9.4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ratings\" (\n \"air_date\" text,\n \"timeslot_est\" text,\n \"season\" text,\n \"rating\" real,\n \"share\" real,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: What is the rating/share with more than 8.88 million viewers and a weekly rant of 27?"
},
{
"role": "assistant",
"content": "SELECT \"18_49_rating_share\" FROM \"ratings\" WHERE \"viewers_m\">8.88 AND \"weekly_rank_num\"='27';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bislett_games\" (\n \"year\" real,\n \"event\" text,\n \"record\" text,\n \"athlete\" text,\n \"nationality\" text\n);\n\nQuestion: Which athlete performed before 1984 in an 800 m event?"
},
{
"role": "assistant",
"content": "SELECT \"athlete\" FROM \"bislett_games\" WHERE \"year\"<1984 AND \"event\"='800 m';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What venue has the away side scoring 6.5 (41)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_12\" WHERE \"away_team_score\"='6.5 (41)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many attended the game when the home team's score is 5.6 (36)?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_12\" WHERE \"home_team_score\"='5.6 (36)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2001_squad_statistics\" (\n \"player\" text,\n \"position\" text,\n \"tries\" real,\n \"goals\" real,\n \"points\" real\n);\n\nQuestion: What is the lowest number of points that Tevita Vaikona scored when making more than 23 tries?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"2001_squad_statistics\" WHERE \"tries\">23 AND \"player\"='tevita vaikona';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2001_squad_statistics\" (\n \"player\" text,\n \"position\" text,\n \"tries\" real,\n \"goals\" real,\n \"points\" real\n);\n\nQuestion: What is the average number of points scored by Joe Vagana when making fewer than 2 tries?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"points\") FROM \"2001_squad_statistics\" WHERE \"player\"='joe vagana' AND \"tries\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the competition that had a win result and a score of 3-1?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"result\"='win' AND \"score\"='3-1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the venue of the match that had a win result and a score of 0-4 in the 2002 Tiger Cup Group Stage?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"international_goals\" WHERE \"result\"='win' AND \"competition\"='2002 tiger cup group stage' AND \"score\"='0-4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the score of the match on July 22, 2008?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"international_goals\" WHERE \"date\"='july 22, 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the score of the 2002 Tiger Cup third/fourth place match?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"international_goals\" WHERE \"competition\"='2002 tiger cup third/fourth place';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: What is the competition on October 15, 2008?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"date\"='october 15, 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_boys_team\" (\n \"player\" text,\n \"height\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: What is the player that went to st. benedict's prep?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"2008_boys_team\" WHERE \"school\"='st. benedict''s prep';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_boys_team\" (\n \"player\" text,\n \"height\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: What is the NBA draft for ohio state?"
},
{
"role": "assistant",
"content": "SELECT \"nba_draft\" FROM \"2008_boys_team\" WHERE \"college\"='ohio state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_boys_team\" (\n \"player\" text,\n \"height\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: What school did the player that is 6-6 go to?"
},
{
"role": "assistant",
"content": "SELECT \"school\" FROM \"2008_boys_team\" WHERE \"height\"='6-6';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008_boys_team\" (\n \"player\" text,\n \"height\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: What school did samardo samuels go to?"
},
{
"role": "assistant",
"content": "SELECT \"school\" FROM \"2008_boys_team\" WHERE \"player\"='samardo samuels';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"boxing\" (\n \"athlete\" text,\n \"event\" text,\n \"round_of_32\" text,\n \"round_of_16\" text,\n \"quarterfinal\" text,\n \"semifinal\" text,\n \"final\" text\n);\n\nQuestion: What is the final for middleweight \u201375 kg?"
},
{
"role": "assistant",
"content": "SELECT \"final\" FROM \"boxing\" WHERE \"event\"='middleweight \u201375 kg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"boxing\" (\n \"athlete\" text,\n \"event\" text,\n \"round_of_32\" text,\n \"round_of_16\" text,\n \"quarterfinal\" text,\n \"semifinal\" text,\n \"final\" text\n);\n\nQuestion: For the light heavyweight \u201381 kg event that did not advance to semifinal, who was the athlete?"
},
{
"role": "assistant",
"content": "SELECT \"athlete\" FROM \"boxing\" WHERE \"semifinal\"='did not advance' AND \"event\"='light heavyweight \u201381 kg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"boxing\" (\n \"athlete\" text,\n \"event\" text,\n \"round_of_32\" text,\n \"round_of_16\" text,\n \"quarterfinal\" text,\n \"semifinal\" text,\n \"final\" text\n);\n\nQuestion: What was the final for rouhollah hosseini?"
},
{
"role": "assistant",
"content": "SELECT \"final\" FROM \"boxing\" WHERE \"athlete\"='rouhollah hosseini';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"boxing\" (\n \"athlete\" text,\n \"event\" text,\n \"round_of_32\" text,\n \"round_of_16\" text,\n \"quarterfinal\" text,\n \"semifinal\" text,\n \"final\" text\n);\n\nQuestion: When the round of 32 was n/a and quarterfinal was did not advance, what was the round of 16?"
},
{
"role": "assistant",
"content": "SELECT \"round_of_16\" FROM \"boxing\" WHERE \"quarterfinal\"='did not advance' AND \"round_of_32\"='n/a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_9\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Can you tell me a date that has a crowd larger than 20,771, and a Venue at Windy Hill?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_9\" WHERE \"crowd\">'20,771' AND \"venue\"='windy hill';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_9\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What Home team that has the Home team score of 9.19 (73)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_9\" WHERE \"home_team_score\"='9.19 (73)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_9\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Can you tell me the Home team that has a Venue of Windy Hill?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_9\" WHERE \"venue\"='windy hill';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_9\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What Venue that has the Away team score of 16.9 (105)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_9\" WHERE \"away_team_score\"='16.9 (105)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_9\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Can you tell me the Away team that has the Away team score of 6.11 (47)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_9\" WHERE \"away_team_score\"='6.11 (47)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\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 lowest attendance at a game when Pittsburgh was the home team?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"regular_season\" WHERE \"home\"='pittsburgh';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\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 date of the game when Atlanta was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"regular_season\" WHERE \"home\"='atlanta';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\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 decision of the game when Montreal was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"decision\" FROM \"regular_season\" WHERE \"home\"='montreal';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\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 date of the game with a decision of Niittymaki and when the Flyers had a record of 30\u201321\u20135?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"regular_season\" WHERE \"decision\"='niittymaki' AND \"record\"='30\u201321\u20135';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"selections\" (\n \"round\" real,\n \"pick\" real,\n \"position\" text,\n \"nationality\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which Position has a Nationality of united states, and a Pick of 9?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"selections\" WHERE \"nationality\"='united states' AND \"pick\"=9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"selections\" (\n \"round\" real,\n \"pick\" real,\n \"position\" text,\n \"nationality\" text,\n \"school_club_team\" text\n);\n\nQuestion: What is the average Pick with a Position of pg, and a Round less than 1?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"pick\") FROM \"selections\" WHERE \"position\"='pg' AND \"round\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: Which top ten, having less than 12 cuts less than 2 top five, and events smaller than 14, is the highest?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"top_10\") FROM \"summary\" WHERE \"cuts_made\"<12 AND \"top_5\"<2 AND \"events\"<14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average for the top five having a number of 42 cuts made."
},
{
"role": "assistant",
"content": "SELECT AVG(\"top_5\") FROM \"summary\" WHERE \"cuts_made\"=42;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"eastern_conference_quarter_finals_vs_2\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: Tell me the score on april 27 with visitor of buffalo"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"eastern_conference_quarter_finals_vs_2\" WHERE \"visitor\"='buffalo' AND \"date\"='april 27';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Where was the game that the home team scored 12.15 (87)?"
},
{
"role": "assistant",
"content": "SELECT \"venue\" FROM \"round_22\" WHERE \"home_team_score\"='12.15 (87)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many people attended Melbourne's away game?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"crowd\") FROM \"round_22\" WHERE \"away_team\"='melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_22\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What was the home team's score when the away team scored 15.17 (107)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_22\" WHERE \"away_team_score\"='15.17 (107)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"golden_point_results\" (\n \"opponent\" text,\n \"result\" text,\n \"score\" text,\n \"date\" text,\n \"venue\" text\n);\n\nQuestion: Who won the game at Dairy farmers stadium with a score of 28-24?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"golden_point_results\" WHERE \"venue\"='dairy farmers stadium' AND \"score\"='28-24';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"golden_point_results\" (\n \"opponent\" text,\n \"result\" text,\n \"score\" text,\n \"date\" text,\n \"venue\" text\n);\n\nQuestion: Who won that game on 24 July 2010?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"golden_point_results\" WHERE \"date\"='24 july 2010';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"golden_point_results\" (\n \"opponent\" text,\n \"result\" text,\n \"score\" text,\n \"date\" text,\n \"venue\" text\n);\n\nQuestion: Who loss the 24-28 game?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"golden_point_results\" WHERE \"result\"='loss' AND \"score\"='24-28';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"golden_point_results\" (\n \"opponent\" text,\n \"result\" text,\n \"score\" text,\n \"date\" text,\n \"venue\" text\n);\n\nQuestion: Who scored 18-19?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"golden_point_results\" WHERE \"score\"='18-19';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Which rank has more than 1 silver and a total nation?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"medal_table\" WHERE \"silver\">1 AND \"nation\"='total';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest total from slovenia with a Gold smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"medal_table\" WHERE \"nation\"='slovenia' AND \"gold\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fleet_details\" (\n \"class\" text,\n \"operator\" text,\n \"no_built\" real,\n \"year_built\" text,\n \"cars_per_set\" real,\n \"unit_nos\" text\n);\n\nQuestion: What class has less than 12 numbers built operated by southern?"
},
{
"role": "assistant",
"content": "SELECT \"class\" FROM \"fleet_details\" WHERE \"no_built\"<12 AND \"operator\"='southern';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"weekly\" (\n \"episode\" text,\n \"air_date\" text,\n \"timeslot\" text,\n \"households_rating_share\" text,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: Tell me the episode with an 18-49 rating of 2.0/5"
},
{
"role": "assistant",
"content": "SELECT \"episode\" FROM \"weekly\" WHERE \"18_49_rating_share\"='2.0/5';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"weekly\" (\n \"episode\" text,\n \"air_date\" text,\n \"timeslot\" text,\n \"households_rating_share\" text,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: Name the episode for viewers bigger than 5.63 and the households rating is 4.5/7"
},
{
"role": "assistant",
"content": "SELECT \"episode\" FROM \"weekly\" WHERE \"viewers_m\">5.63 AND \"households_rating_share\"='4.5/7';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"weekly\" (\n \"episode\" text,\n \"air_date\" text,\n \"timeslot\" text,\n \"households_rating_share\" text,\n \"18_49_rating_share\" text,\n \"viewers_m\" real,\n \"weekly_rank_num\" text\n);\n\nQuestion: Name the 18-49 rating for weekly rank of 30"
},
{
"role": "assistant",
"content": "SELECT \"18_49_rating_share\" FROM \"weekly\" WHERE \"weekly_rank_num\"='30';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text\n);\n\nQuestion: Who was the driver with 29 laps?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"race\" WHERE \"laps\"='29';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text\n);\n\nQuestion: What was the retired time for someone who was on grid 18?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"grid\"='18';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text\n);\n\nQuestion: Jacques Villeneuve was on what grid?"
},
{
"role": "assistant",
"content": "SELECT \"grid\" FROM \"race\" WHERE \"driver\"='jacques villeneuve';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text\n);\n\nQuestion: What's the time for someone on grid 9?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"grid\"='9';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text\n);\n\nQuestion: What was the grid of Alex Yoong?"
},
{
"role": "assistant",
"content": "SELECT \"grid\" FROM \"race\" WHERE \"driver\"='alex yoong';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_6\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What date was the game played at Lake Oval?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_6\" WHERE \"venue\"='lake oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_6\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How many people came to the game at Victoria Park?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_6\" WHERE \"venue\"='victoria park';"
}
] |
[
{
"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 lost to moyer (9\u20134)?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"loss\"='moyer (9\u20134)';"
}
] |
[
{
"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 attended when the record was broken with 47\u201363?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"game_log\" WHERE \"record\"='47\u201363';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_4\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who is the home team that played the away team that scored 11.13 (79)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_4\" WHERE \"away_team_score\"='11.13 (79)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_4\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the score of the home team that played Collingwood?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_4\" WHERE \"away_team\"='collingwood';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_4\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who is the away team that played at punt road oval where the crowd was larger than 12,000?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_4\" WHERE \"crowd\">'12,000' AND \"venue\"='punt road oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"january\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Who was the visitor when ward recorded the decision with a record of 22\u201321\u20134?"
},
{
"role": "assistant",
"content": "SELECT \"visitor\" FROM \"january\" WHERE \"decision\"='ward' AND \"record\"='22\u201321\u20134';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"january\" (\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 is the score of the game when they had a record of 22\u201319\u20134?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"january\" WHERE \"record\"='22\u201319\u20134';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_first_week_sales\" (\n \"number\" real,\n \"artist\" text,\n \"album\" text,\n \"1st_week_sales\" real,\n \"1st_week_position\" text\n);\n\nQuestion: What is the 1st week sales for the album finding forever before the number 6?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"1st_week_sales\") FROM \"highest_first_week_sales\" WHERE \"album\"='finding forever' AND \"number\"<6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_first_week_sales\" (\n \"number\" real,\n \"artist\" text,\n \"album\" text,\n \"1st_week_sales\" real,\n \"1st_week_position\" text\n);\n\nQuestion: What is the album for the number 6 with the 1st week position of #1?"
},
{
"role": "assistant",
"content": "SELECT \"album\" FROM \"highest_first_week_sales\" WHERE \"1st_week_position\"='#1' AND \"number\"=6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the sum number of grid where time/retired is 2:41:38.4 and laps were more than 40?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"grid\") FROM \"classification\" WHERE \"time_retired\"='2:41:38.4' AND \"laps\">40;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which constructor had laps amounting to more than 21 where the driver was John Surtees?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"classification\" WHERE \"laps\">21 AND \"driver\"='john surtees';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: How many laps did Jo Bonnier driver when the grid number was smaller than 11?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"laps\") FROM \"classification\" WHERE \"driver\"='jo bonnier' AND \"grid\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: How many laps were there when time/retired was gearbox?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"laps\") FROM \"classification\" WHERE \"time_retired\"='gearbox';"
}
] |
[
{
"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 \"leading_scorer\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: How many were in attendance at the game where the visiting team was the Jazz?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"february\" WHERE \"visitor\"='jazz';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: Who did the Chiefs play at the game attended by 34,063?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"season_schedule\" WHERE \"attendance\"='34,063';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: Which week's game was attended by 33,057 people?"
},
{
"role": "assistant",
"content": "SELECT \"week\" FROM \"season_schedule\" WHERE \"attendance\"='33,057';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the organisation when the year is less than 2005 and the award is the best variety show host?"
},
{
"role": "assistant",
"content": "SELECT \"organisation\" FROM \"awards_achievements\" WHERE \"year\"<2005 AND \"award\"='best variety show host';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the organisation when the nominated work title is n/a in the year 2005?"
},
{
"role": "assistant",
"content": "SELECT \"organisation\" FROM \"awards_achievements\" WHERE \"nominated_work_title\"='n/a' AND \"year\"=2005;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the lowest year with the result is nominated for the work title is love bites?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"awards_achievements\" WHERE \"result\"='nominated' AND \"nominated_work_title\"='love bites';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the year when then organisation is star awards, the result is won and the nominated work title is n/a?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"awards_achievements\" WHERE \"organisation\"='star awards' AND \"result\"='won' AND \"nominated_work_title\"='n/a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the latest year that has the result of nominated and the nominated work title is n/a?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"awards_achievements\" WHERE \"result\"='nominated' AND \"nominated_work_title\"='n/a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_achievements\" (\n \"year\" real,\n \"organisation\" text,\n \"award\" text,\n \"nominated_work_title\" text,\n \"result\" text\n);\n\nQuestion: what is the nominated work title when the result is won, the organisation is star awards and the award is top 10 most popular female artiste in the year 2007?"
},
{
"role": "assistant",
"content": "SELECT \"nominated_work_title\" FROM \"awards_achievements\" WHERE \"result\"='won' AND \"organisation\"='star awards' AND \"award\"='top 10 most popular female artiste' AND \"year\">2007;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"asian_games\" (\n \"games\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"total\" text,\n \"rank\" text\n);\n\nQuestion: What is the rank of the games that had 9 gold and 9 silvers?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"asian_games\" WHERE \"gold\"='9' AND \"silver\"='9';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"asian_games\" (\n \"games\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"total\" text,\n \"rank\" text\n);\n\nQuestion: How many golds were there in a game that has 17 bronze and a total of 31?"
},
{
"role": "assistant",
"content": "SELECT \"gold\" FROM \"asian_games\" WHERE \"bronze\"='17' AND \"total\"='31';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"asian_games\" (\n \"games\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"total\" text,\n \"rank\" text\n);\n\nQuestion: Which game had 8 bronze and 4 gold?"
},
{
"role": "assistant",
"content": "SELECT \"games\" FROM \"asian_games\" WHERE \"bronze\"='8' AND \"gold\"='4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"march\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: When did San Jose visit the St. Louis?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"march\" WHERE \"visitor\"='san jose';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_grand_prix_wins_by_en\" (\n \"rank\" real,\n \"engine\" text,\n \"wins\" real,\n \"first_win\" text,\n \"latest_win\" text\n);\n\nQuestion: How many total wins with the latest win at the 1999 Italian Grand Prix at a rank of 15?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"wins\") FROM \"world_championship_grand_prix_wins_by_en\" WHERE \"latest_win\"='1999 italian grand prix' AND \"rank\">15;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_grand_prix_wins_by_en\" (\n \"rank\" real,\n \"engine\" text,\n \"wins\" real,\n \"first_win\" text,\n \"latest_win\" text\n);\n\nQuestion: What is the rank 6 lowest win who's first win was at the 1950 British Grand Prix?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"wins\") FROM \"world_championship_grand_prix_wins_by_en\" WHERE \"rank\">6 AND \"first_win\"='1950 british grand prix';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"world_championship_grand_prix_wins_by_en\" (\n \"rank\" real,\n \"engine\" text,\n \"wins\" real,\n \"first_win\" text,\n \"latest_win\" text\n);\n\nQuestion: What is the rank 16 wins with the latest win at the 1967 Belgian Grand Prix?"
},
{
"role": "assistant",
"content": "SELECT \"wins\" FROM \"world_championship_grand_prix_wins_by_en\" WHERE \"rank\">16 AND \"latest_win\"='1967 belgian grand prix';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" text,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: What's the lowest pick for a defensive back at Drake?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pick\") FROM \"nfl_draft\" WHERE \"position\"='defensive back' AND \"school\"='drake';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" text,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: What's terry jones' lowest pick?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pick\") FROM \"nfl_draft\" WHERE \"player\"='terry jones';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.