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 \"list_of_a_star_talent_search_winners\" (\n \"year\" real,\n \"award\" text,\n \"name\" text,\n \"institution\" text,\n \"chief_judge\" text\n);\n\nQuestion: What institution won in 2010 with student Cheng Herng Yi?"
},
{
"role": "assistant",
"content": "SELECT \"institution\" FROM \"list_of_a_star_talent_search_winners\" WHERE \"year\">2010 AND \"name\"='cheng herng yi';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"relegation_round\" (\n \"position\" real,\n \"name\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points\" real\n);\n\nQuestion: What was the lowest postion of ehc straubing ii when they played less than 10 games?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"position\") FROM \"relegation_round\" WHERE \"name\"='ehc straubing ii' AND \"played\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"relegation_round\" (\n \"position\" real,\n \"name\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points\" real\n);\n\nQuestion: What was the drawn amount for teams with points of 12 and played smaller than 10?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"drawn\") FROM \"relegation_round\" WHERE \"points\"=12 AND \"played\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"relegation_round\" (\n \"position\" real,\n \"name\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"points\" real\n);\n\nQuestion: How many games were played by the team with 2 draws, less than 16 points and a position higher than 5?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"played\") FROM \"relegation_round\" WHERE \"drawn\"=2 AND \"points\"<16 AND \"position\">5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: What was the grid of Buddy Rice?"
},
{
"role": "assistant",
"content": "SELECT \"grid\" FROM \"classification\" WHERE \"driver\"='buddy rice';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: Which team had a driver with a finish position of 7?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"classification\" WHERE \"fin_pos\"='7';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: What was the time of the driver with a finish position of 19?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"fin_pos\"='19';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: What were the number of laps led by the driver with a finish position of 14?"
},
{
"role": "assistant",
"content": "SELECT \"laps_led\" FROM \"classification\" WHERE \"fin_pos\"='14';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"fin_pos\" text,\n \"car_no\" text,\n \"driver\" text,\n \"team\" text,\n \"laps\" text,\n \"time_retired\" text,\n \"grid\" text,\n \"laps_led\" text,\n \"points\" text\n);\n\nQuestion: Which team had a finish position of 8?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"classification\" WHERE \"fin_pos\"='8';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"women_s_records\" (\n \"event\" text,\n \"score\" real,\n \"name\" text,\n \"nation\" text,\n \"games\" text,\n \"date\" text\n);\n\nQuestion: For the 27 arrow match event, what's the sum of all scores for that event?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"score\") FROM \"women_s_records\" WHERE \"event\"='27 arrow match';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"women_s_records\" (\n \"event\" text,\n \"score\" real,\n \"name\" text,\n \"nation\" text,\n \"games\" text,\n \"date\" text\n);\n\nQuestion: Which event had a score of over 673 points?"
},
{
"role": "assistant",
"content": "SELECT \"event\" FROM \"women_s_records\" WHERE \"score\">673;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"most_appearances\" (\n \"player\" text,\n \"position\" text,\n \"premier_league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"uefa_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of appearances in the premier league when there were 10 appearances at UEFA and less than 4 at league cup?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"premier_league\") FROM \"most_appearances\" WHERE \"uefa_cup\"=10 AND \"league_cup\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"most_appearances\" (\n \"player\" text,\n \"position\" text,\n \"premier_league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"uefa_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the highest total number of appearances when there were less than 4 at the FA cup?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"total\") FROM \"most_appearances\" WHERE \"fa_cup\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"most_appearances\" (\n \"player\" text,\n \"position\" text,\n \"premier_league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"uefa_cup\" real,\n \"total\" real\n);\n\nQuestion: What player had less than 6 appearances at the FA cup, 33 at the premier league, and more than 5 at the UEFA cup?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"most_appearances\" WHERE \"fa_cup\"<6 AND \"premier_league\"=33 AND \"uefa_cup\">5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"most_appearances\" (\n \"player\" text,\n \"position\" text,\n \"premier_league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"uefa_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of the appearances at the league cup for the defender who had less than 10 appearances at the UEFA cup?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"league_cup\") FROM \"most_appearances\" WHERE \"position\"='defender' AND \"uefa_cup\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cancer_immunotherapy_monoclonal_antibodi\" (\n \"antibody\" text,\n \"brand_name\" text,\n \"approval_date\" real,\n \"type\" text,\n \"target\" text\n);\n\nQuestion: What's the target of the antibody rituximab?"
},
{
"role": "assistant",
"content": "SELECT \"target\" FROM \"cancer_immunotherapy_monoclonal_antibodi\" WHERE \"antibody\"='rituximab';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cancer_immunotherapy_monoclonal_antibodi\" (\n \"antibody\" text,\n \"brand_name\" text,\n \"approval_date\" real,\n \"type\" text,\n \"target\" text\n);\n\nQuestion: What's the target for the brand mylotarg?"
},
{
"role": "assistant",
"content": "SELECT \"target\" FROM \"cancer_immunotherapy_monoclonal_antibodi\" WHERE \"brand_name\"='mylotarg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cancer_immunotherapy_monoclonal_antibodi\" (\n \"antibody\" text,\n \"brand_name\" text,\n \"approval_date\" real,\n \"type\" text,\n \"target\" text\n);\n\nQuestion: What's the type for the brand herceptin with an approval date of before 2006?"
},
{
"role": "assistant",
"content": "SELECT \"type\" FROM \"cancer_immunotherapy_monoclonal_antibodi\" WHERE \"approval_date\"<2006 AND \"brand_name\"='herceptin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"huskers_in_the\" (\n \"player\" text,\n \"position\" text,\n \"round\" real,\n \"overall\" real,\n \"mlb_team\" text\n);\n\nQuestion: What is Position, when Overall is less than 590, and when Round is 3?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"huskers_in_the\" WHERE \"overall\"<590 AND \"round\"=3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"huskers_in_the\" (\n \"player\" text,\n \"position\" text,\n \"round\" real,\n \"overall\" real,\n \"mlb_team\" text\n);\n\nQuestion: What is Player, when MLB Team is \"Florida Marlins\", and when Round is less than 15?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"huskers_in_the\" WHERE \"mlb_team\"='florida marlins' AND \"round\"<15;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"huskers_in_the\" (\n \"player\" text,\n \"position\" text,\n \"round\" real,\n \"overall\" real,\n \"mlb_team\" text\n);\n\nQuestion: What is the lowest Overall, when Player is \"Dan Jennings\", and when Round is greater than 9?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"overall\") FROM \"huskers_in_the\" WHERE \"player\"='dan jennings' AND \"round\">9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"huskers_in_the\" (\n \"player\" text,\n \"position\" text,\n \"round\" real,\n \"overall\" real,\n \"mlb_team\" text\n);\n\nQuestion: What is the total number of Round, when Position is 2B?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"round\") FROM \"huskers_in_the\" WHERE \"position\"='2b';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"point_standings\" (\n \"driver\" text,\n \"points\" real,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real\n);\n\nQuestion: What are the highest points for Justin Lofton when his top 10 is lower than 5?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"points\") FROM \"point_standings\" WHERE \"driver\"='justin lofton' AND \"top_10\"<5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"point_standings\" (\n \"driver\" text,\n \"points\" real,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real\n);\n\nQuestion: What is Frank Kimmel's lowest top 5 with more than 0 wins and fewer than 14 top 10s?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"top_5\") FROM \"point_standings\" WHERE \"wins\">0 AND \"driver\"='frank kimmel' AND \"top_10\"<14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"point_standings\" (\n \"driver\" text,\n \"points\" real,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real\n);\n\nQuestion: What is the lowest top 10 with fewer than 4 wins, fewer than 3260 points and more than 0 for top 5?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"top_10\") FROM \"point_standings\" WHERE \"wins\"<4 AND \"points\"<3260 AND \"top_5\">0;"
}
] |
[
{
"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 \"country\" text,\n \"mark\" text\n);\n\nQuestion: When the mark is 7.35, what's the lowest Lane found?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"lane\") FROM \"heats\" WHERE \"mark\"='7.35';"
}
] |
[
{
"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 \"country\" text,\n \"mark\" text\n);\n\nQuestion: What's the lowest lane found for a mark of 8.09 pb?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"lane\") FROM \"heats\" WHERE \"mark\"='8.09 pb';"
}
] |
[
{
"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 \"country\" text,\n \"mark\" text\n);\n\nQuestion: What's the sum of all of ivet lalova's Heat stats?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"heat\") FROM \"heats\" WHERE \"name\"='ivet lalova';"
}
] |
[
{
"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 \"country\" text,\n \"mark\" text\n);\n\nQuestion: What's the total number of Heat recorded for the british virgin islands?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"heat\") FROM \"heats\" WHERE \"country\"='british virgin islands';"
}
] |
[
{
"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 \"country\" text,\n \"mark\" text\n);\n\nQuestion: When the lane is under 2 and the name is virgen benavides with a mark of 7.29, what's the total number of Heat found?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"heat\") FROM \"heats\" WHERE \"mark\"='7.29' AND \"name\"='virgen benavides' AND \"lane\"<2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text,\n \"time\" text\n);\n\nQuestion: What's the Time for the Competition of european cup and has a Venue of Moscow?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"achievements\" WHERE \"competition\"='european cup' AND \"venue\"='moscow';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text,\n \"time\" text\n);\n\nQuestion: What's the Time for an Event of 4x100 m relay and has a Venue of Frankfurt?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"achievements\" WHERE \"event\"='4x100 m relay' AND \"venue\"='frankfurt';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text,\n \"time\" text\n);\n\nQuestion: What Competition has an Event of 4x100 m relay and has the Time of 38.89?"
},
{
"role": "assistant",
"content": "SELECT \"competition\" FROM \"achievements\" WHERE \"event\"='4x100 m relay' AND \"time\"='38.89';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text,\n \"time\" text\n);\n\nQuestion: What's the lowest Year with a Venue of casablanca and has the Time of 20.63w?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"achievements\" WHERE \"venue\"='casablanca' AND \"time\"='20.63w';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"nationality\" text,\n \"college_junior_club_team\" text\n);\n\nQuestion: What was the College/junior/club team of the player with the united states nationality?"
},
{
"role": "assistant",
"content": "SELECT \"college_junior_club_team\" FROM \"draft_picks\" WHERE \"nationality\"='united states';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_picks\" (\n \"round\" real,\n \"pick\" real,\n \"player\" text,\n \"nationality\" text,\n \"college_junior_club_team\" text\n);\n\nQuestion: What was the lowest pick number for a united states player picked before round 7?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"pick\") FROM \"draft_picks\" WHERE \"round\">7 AND \"nationality\"='united states';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What country was the player with the score line 69-71-72-69=281 from?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"final_leaderboard\" WHERE \"score\"='69-71-72-69=281';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What was the score of the player from South Africa?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"final_leaderboard\" WHERE \"country\"='south africa';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What country did the player with the score line 73-74-72-64=283 from?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"final_leaderboard\" WHERE \"score\"='73-74-72-64=283';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"top_fuel\" text,\n \"funny_car\" text,\n \"pro_stock\" text,\n \"pro_stock_motorcycle\" text\n);\n\nQuestion: Who won Pro Stock Motorcycle the year Tom Martino won Pro Stock?"
},
{
"role": "assistant",
"content": "SELECT \"pro_stock_motorcycle\" FROM \"winners\" WHERE \"pro_stock\"='tom martino';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"top_fuel\" text,\n \"funny_car\" text,\n \"pro_stock\" text,\n \"pro_stock_motorcycle\" text\n);\n\nQuestion: Who won Funny Car in 2012?"
},
{
"role": "assistant",
"content": "SELECT \"funny_car\" FROM \"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 \"winners\" (\n \"year\" real,\n \"top_fuel\" text,\n \"funny_car\" text,\n \"pro_stock\" text,\n \"pro_stock_motorcycle\" text\n);\n\nQuestion: Who won Funny Car when Jim Yates won Pro Stock, in years after 1996?"
},
{
"role": "assistant",
"content": "SELECT \"funny_car\" FROM \"winners\" WHERE \"pro_stock\"='jim yates' AND \"year\">1996;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"top_fuel\" text,\n \"funny_car\" text,\n \"pro_stock\" text,\n \"pro_stock_motorcycle\" text\n);\n\nQuestion: Who won Pro Stock the year Tony Schumacher won Top Fuel and Tony Pedregon won Funny Car?"
},
{
"role": "assistant",
"content": "SELECT \"pro_stock\" FROM \"winners\" WHERE \"top_fuel\"='tony schumacher' AND \"funny_car\"='tony pedregon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"winners\" (\n \"year\" real,\n \"top_fuel\" text,\n \"funny_car\" text,\n \"pro_stock\" text,\n \"pro_stock_motorcycle\" text\n);\n\nQuestion: In which year did John Force win Funny Car and Mike Dunn win in Top Fuel?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"winners\" WHERE \"funny_car\"='john force' AND \"top_fuel\"='mike dunn';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What is the total number of races in the 2006 season with 0 poles and more than 0 podiums?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"races\") FROM \"by_seasons_and_teams\" WHERE \"poles\"=0 AND \"season\"='2006' AND \"podiums\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What is the highest number of the fastest laps when there were 0 poles, more than 2 podiums, and more than 15 races?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"fastest_laps\") FROM \"by_seasons_and_teams\" WHERE \"poles\"=0 AND \"races\">15 AND \"podiums\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What is the total number of races when there was more than 1 pole, and the fastest number of laps was less than 4?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"races\") FROM \"by_seasons_and_teams\" WHERE \"poles\">1 AND \"fastest_laps\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What was the average number of fastest laps with less than 0 poles?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"fastest_laps\") FROM \"by_seasons_and_teams\" WHERE \"poles\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What is the smallest number of poles when the fastest laps are less than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"poles\") FROM \"by_seasons_and_teams\" WHERE \"fastest_laps\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"by_seasons_and_teams\" (\n \"season\" text,\n \"races\" real,\n \"wins\" real,\n \"podiums\" real,\n \"poles\" real,\n \"fastest_laps\" real\n);\n\nQuestion: What is the total number of wins in the 2007 season when the fastest laps is 0, there are less than 0 podiums, and there are less than 16 races?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"wins\") FROM \"by_seasons_and_teams\" WHERE \"fastest_laps\"=0 AND \"races\"<16 AND \"season\"='2007' AND \"podiums\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_finals_6_2\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What surface did hayley ericksen play on?"
},
{
"role": "assistant",
"content": "SELECT \"surface\" FROM \"doubles_finals_6_2\" WHERE \"partner\"='hayley ericksen';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_finals_6_2\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: Who were the opponents on a hard surface with a score of 6-4, 7-6(2)?"
},
{
"role": "assistant",
"content": "SELECT \"opponents_in_the_final\" FROM \"doubles_finals_6_2\" WHERE \"surface\"='hard' AND \"score\"='6-4, 7-6(2)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"doubles_finals_6_2\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score\" text\n);\n\nQuestion: What was hayley ericksen's score?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"doubles_finals_6_2\" WHERE \"partner\"='hayley ericksen';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"women\" (\n \"year\" real,\n \"location\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text\n);\n\nQuestion: Who won the Silver the Year Katie Curtis Unknown won the Bronze?"
},
{
"role": "assistant",
"content": "SELECT \"silver\" FROM \"women\" WHERE \"bronze\"='katie curtis unknown';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: Round that greg huntington went in?"
},
{
"role": "assistant",
"content": "SELECT \"round\" FROM \"washington_redskins_draft_history\" WHERE \"name\"='greg huntington';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: Total overall from penn state?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"college\"='penn state';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"coaching_history\" (\n \"coach\" text,\n \"years\" text,\n \"seasons\" real,\n \"record\" text,\n \"pct\" real,\n \"nat_titles\" real\n);\n\nQuestion: How many seasons did Pat Chambers coach?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"seasons\") FROM \"coaching_history\" WHERE \"coach\"='pat chambers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: What was the to par that goes with the score 68-74-69=211?"
},
{
"role": "assistant",
"content": "SELECT \"to_par\" FROM \"third_round\" WHERE \"score\"='68-74-69=211';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: What country is Paul Stankowski from?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"third_round\" WHERE \"player\"='paul stankowski';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: What place goes with the score of 70-66-65=201?"
},
{
"role": "assistant",
"content": "SELECT \"place\" FROM \"third_round\" WHERE \"score\"='70-66-65=201';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: When Fred Funk had a to par of E, what was the score?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"third_round\" WHERE \"to_par\"='e' AND \"player\"='fred funk';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" text,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: Where is the location where Scott Junk was the opponent?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"mixed_martial_arts_record\" WHERE \"opponent\"='scott junk';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: what is the score on 14 december 1974 and the away team is crystal palace?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"second_round_proper\" WHERE \"date\"='14 december 1974' AND \"away_team\"='crystal palace';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: what is the date when the away team is crystal palace?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"second_round_proper\" WHERE \"away_team\"='crystal palace';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current\" (\n \"name\" text,\n \"pos\" text,\n \"height\" text,\n \"weight\" text,\n \"2012_club\" text\n);\n\nQuestion: What is the height of the player with the 2012 club of asd roma?"
},
{
"role": "assistant",
"content": "SELECT \"height\" FROM \"current\" WHERE \"2012_club\"='asd roma';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fourth_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: What was the Tie Number of the Bradford City away team?"
},
{
"role": "assistant",
"content": "SELECT \"tie_no\" FROM \"fourth_round_proper\" WHERE \"away_team\"='bradford city';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fourth_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: Who was the home team that had a replay of Tie Number and played against the Bolton Wanderers?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"fourth_round_proper\" WHERE \"tie_no\"='replay' AND \"away_team\"='bolton wanderers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"fourth_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: What date has a Tie Number of 4?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"fourth_round_proper\" WHERE \"tie_no\"='4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What is the average money ($) that Tom Weiskopf made?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"money\") FROM \"final_leaderboard\" WHERE \"player\"='tom weiskopf';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: What place did the golfer from the United States come in with a To Par of +2, and a score of 73-74-71-72=290?"
},
{
"role": "assistant",
"content": "SELECT \"place\" FROM \"final_leaderboard\" WHERE \"country\"='united states' AND \"to_par\"='+2' AND \"score\"='73-74-71-72=290';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cardinal_numbers\" (\n \"number_notation\" real,\n \"power_notation\" text,\n \"short_scale\" text,\n \"long_scale\" text,\n \"indian_or_south_asian_english\" text\n);\n\nQuestion: For the number notion more than 1,000,000 with a power notion of 10 12, what is the short scale?"
},
{
"role": "assistant",
"content": "SELECT \"short_scale\" FROM \"cardinal_numbers\" WHERE \"number_notation\">'1,000,000' AND \"power_notation\"='10 12';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cardinal_numbers\" (\n \"number_notation\" real,\n \"power_notation\" text,\n \"short_scale\" text,\n \"long_scale\" text,\n \"indian_or_south_asian_english\" text\n);\n\nQuestion: For a long scale of one million, what is the power notion?"
},
{
"role": "assistant",
"content": "SELECT \"power_notation\" FROM \"cardinal_numbers\" WHERE \"long_scale\"='one million';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cardinal_numbers\" (\n \"number_notation\" real,\n \"power_notation\" text,\n \"short_scale\" text,\n \"long_scale\" text,\n \"indian_or_south_asian_english\" text\n);\n\nQuestion: For a power notation of 10 12, what is the long scale?"
},
{
"role": "assistant",
"content": "SELECT \"long_scale\" FROM \"cardinal_numbers\" WHERE \"power_notation\"='10 12';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"cardinal_numbers\" (\n \"number_notation\" real,\n \"power_notation\" text,\n \"short_scale\" text,\n \"long_scale\" text,\n \"indian_or_south_asian_english\" text\n);\n\nQuestion: For a short scale of one quadrillion a thousand trillion, what is the Long scale?"
},
{
"role": "assistant",
"content": "SELECT \"long_scale\" FROM \"cardinal_numbers\" WHERE \"short_scale\"='one quadrillion a thousand trillion';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"draft_lottery\" (\n \"pick_num\" real,\n \"brand_to\" text,\n \"employee_real_name\" text,\n \"role\" text,\n \"brand_from\" text\n);\n\nQuestion: what is the employee (real name) when the pick # is higher than 10 and the brand (to) is raw?"
},
{
"role": "assistant",
"content": "SELECT \"employee_real_name\" FROM \"draft_lottery\" WHERE \"pick_num\">10 AND \"brand_to\"='raw';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_cup\" (\n \"match\" real,\n \"date\" text,\n \"round\" text,\n \"home_away\" text,\n \"opponent_team\" text,\n \"score\" text,\n \"scorers\" text\n);\n\nQuestion: Who was the opposing team when the scorer was ronaldinho 90+3'?"
},
{
"role": "assistant",
"content": "SELECT \"opponent_team\" FROM \"uefa_cup\" WHERE \"scorers\"='ronaldinho 90+3''';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_cup\" (\n \"match\" real,\n \"date\" text,\n \"round\" text,\n \"home_away\" text,\n \"opponent_team\" text,\n \"score\" text,\n \"scorers\" text\n);\n\nQuestion: Who was the opposing team when the scorers were jong-a-pin 19'( o.g. ) , gattuso 23' , inzaghi 69'?"
},
{
"role": "assistant",
"content": "SELECT \"opponent_team\" FROM \"uefa_cup\" WHERE \"scorers\"='jong-a-pin 19''( o.g. ) , gattuso 23'' , inzaghi 69''';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"third_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"date\" text\n);\n\nQuestion: What was the score when Altrincham was home?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"third_round_proper\" WHERE \"home_team\"='altrincham';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: How many goals against when the draws are fewer than 3?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals_against\") FROM \"premier_division_final_table\" WHERE \"drawn\"<3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: How many goals when the points 1 is 38 and the played number is less than 42?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"goals_for\") FROM \"premier_division_final_table\" WHERE \"points_1\"=38 AND \"played\"<42;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is the fewest goals for when goal difference is +10 and goals against is more than 61?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"goals_for\") FROM \"premier_division_final_table\" WHERE \"goal_difference\"='+10' AND \"goals_against\">61;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"premier_division_final_table\" (\n \"position\" real,\n \"team\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" text,\n \"points_1\" real\n);\n\nQuestion: What is the fewest goals for when goals against is 75 and drawn is smaller than 11?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"goals_for\") FROM \"premier_division_final_table\" WHERE \"goals_against\"=75 AND \"drawn\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"played\" real,\n \"points\" real,\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 highest goals for the position after 10, a goal difference less than -24, and played more than 30 times?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals_for\") FROM \"group_ii\" WHERE \"position\">10 AND \"goal_difference\"<-24 AND \"played\">30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"played\" real,\n \"points\" real,\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 lowest goals for more than 30 games played?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"goals_for\") FROM \"group_ii\" WHERE \"played\">30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"played\" real,\n \"points\" real,\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 highest amount of goals in the position after 8, 12 losses, and played less than 30 games?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals_for\") FROM \"group_ii\" WHERE \"position\">8 AND \"losses\"=12 AND \"played\"<30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"played\" real,\n \"points\" real,\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 total number of losses for the over 30 games played?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"group_ii\" WHERE \"played\">30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"group_ii\" (\n \"position\" real,\n \"played\" real,\n \"points\" real,\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 total number of losses and draws less than 7, points larger than 26, 60 goals, and a position before 4?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"group_ii\" WHERE \"draws\"<7 AND \"points\">26 AND \"goals_for\"=60 AND \"position\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the highest total for bronze with a gold larger than 0, a silver smaller than 5, and a total of 15?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"bronze\") FROM \"medal_table\" WHERE \"gold\">0 AND \"total\"=15 AND \"silver\"<5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is Score, when High Points is \"Dwight Howard (25)\"?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"high_points\"='dwight howard (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 \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is Score, when Team is \"Washington\"?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"team\"='washington';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is Record, when Location Attendance is \"Pepsi Center 19,749\"?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"location_attendance\"='pepsi center 19,749';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is Record, when Game is \"36\"?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"game\"=36;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Date, when Winning Score is \u221214 (68-68-67-71=274)?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"pga_tour_wins_9\" WHERE \"winning_score\"='\u221214 (68-68-67-71=274)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is the Margin of Victory, when Tournament is Mercedes Championships (3)?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"pga_tour_wins_9\" WHERE \"tournament\"='mercedes championships (3)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Date, when Tournament, is Greenbrier Classic?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"pga_tour_wins_9\" WHERE \"tournament\"='greenbrier classic';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Runner(s)-Up when Margin of Victory is 6 Strokes?"
},
{
"role": "assistant",
"content": "SELECT \"runner_s_up\" FROM \"pga_tour_wins_9\" WHERE \"margin_of_victory\"='6 strokes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_9\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Date, when Runner(s)-Up is Jonathan Kaye?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"pga_tour_wins_9\" WHERE \"runner_s_up\"='jonathan kaye';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colles\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What is the year that nahete colles was named?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year_named\") FROM \"colles\" WHERE \"name\"='nahete colles';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colles\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What year was the geological feature with a latitude of 76.0n and a diameter larger than 548 km was named?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year_named\") FROM \"colles\" WHERE \"latitude\"='76.0n' AND \"diameter_km\">548;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"colles\" (\n \"name\" text,\n \"latitude\" text,\n \"longitude\" text,\n \"diameter_km\" real,\n \"year_named\" real\n);\n\nQuestion: What is the diameter in km of t'ien hu colles?"
},
{
"role": "assistant",
"content": "SELECT \"diameter_km\" FROM \"colles\" WHERE \"name\"='t''ien hu colles';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.