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 \"administration\" (\n \"english_name\" text,\n \"simplified\" text,\n \"traditional\" text,\n \"pinyin\" text,\n \"hakka\" text,\n \"area\" real,\n \"population\" real,\n \"density\" real\n);\n\nQuestion: What's the sum of the population for the place simplified \u4e0a\u676d\u53bf with an area smaller than 2,879?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"population\") FROM \"administration\" WHERE \"simplified\"='\u4e0a\u676d\u53bf' AND \"area\"<'2,879';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"administration\" (\n \"english_name\" text,\n \"simplified\" text,\n \"traditional\" text,\n \"pinyin\" text,\n \"hakka\" text,\n \"area\" real,\n \"population\" real,\n \"density\" real\n);\n\nQuestion: What's the total number of density for the place with a population over 393,390?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"density\") FROM \"administration\" WHERE \"population\">'393,390';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"administration\" (\n \"english_name\" text,\n \"simplified\" text,\n \"traditional\" text,\n \"pinyin\" text,\n \"hakka\" text,\n \"area\" real,\n \"population\" real,\n \"density\" real\n);\n\nQuestion: What's the average area for the xinluo district?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"area\") FROM \"administration\" WHERE \"english_name\"='xinluo district';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What was the attendance on July 30?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"attendance\") FROM \"game_log\" WHERE \"date\"='july 30';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_career\" (\n \"date\" text,\n \"venue\" text,\n \"result\" text,\n \"goals\" real,\n \"competition\" text\n);\n\nQuestion: How many Goals have a Result of 0 \u2013 4?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"goals\") FROM \"international_career\" WHERE \"result\"='0 \u2013 4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_career\" (\n \"date\" text,\n \"venue\" text,\n \"result\" text,\n \"goals\" real,\n \"competition\" text\n);\n\nQuestion: How many goals have a Result of 12 \u2013 0?"
},
{
"role": "assistant",
"content": "SELECT \"goals\" FROM \"international_career\" WHERE \"result\"='12 \u2013 0';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_career\" (\n \"date\" text,\n \"venue\" text,\n \"result\" text,\n \"goals\" real,\n \"competition\" text\n);\n\nQuestion: Which Result has a Date of 9 october 2009?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"international_career\" WHERE \"date\"='9 october 2009';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international_career\" (\n \"date\" text,\n \"venue\" text,\n \"result\" text,\n \"goals\" real,\n \"competition\" text\n);\n\nQuestion: Which Goals have a Date of 7 february 2010?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"goals\") FROM \"international_career\" WHERE \"date\"='7 february 2010';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"pts\" real\n);\n\nQuestion: On what Year did Entrant Leyton House have a Chassis type of Leyton House CG911?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"complete_formula_one_results\" WHERE \"entrant\"='leyton house' AND \"chassis\"='leyton house cg911';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"pts\" real\n);\n\nQuestion: What was the first year to have a Chassis of Jordan 193?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"complete_formula_one_results\" WHERE \"chassis\"='jordan 193';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"school\" text,\n \"mascot\" text,\n \"location\" text,\n \"league\" text,\n \"enrollment\" real\n);\n\nQuestion: Which School's Mascot is Raiders?"
},
{
"role": "assistant",
"content": "SELECT \"school\" FROM \"current_members\" WHERE \"mascot\"='raiders';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"school\" text,\n \"mascot\" text,\n \"location\" text,\n \"league\" text,\n \"enrollment\" real\n);\n\nQuestion: What is North Valleys School Mascot?"
},
{
"role": "assistant",
"content": "SELECT \"mascot\" FROM \"current_members\" WHERE \"school\"='north valleys';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"school\" text,\n \"mascot\" text,\n \"location\" text,\n \"league\" text,\n \"enrollment\" real\n);\n\nQuestion: What is the Enrollment where Cougars is a Mascot?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"enrollment\") FROM \"current_members\" WHERE \"mascot\"='cougars';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"school\" text,\n \"mascot\" text,\n \"location\" text,\n \"league\" text,\n \"enrollment\" real\n);\n\nQuestion: In what League is the Reed School?"
},
{
"role": "assistant",
"content": "SELECT \"league\" FROM \"current_members\" WHERE \"school\"='reed';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"school\" text,\n \"mascot\" text,\n \"location\" text,\n \"league\" text,\n \"enrollment\" real\n);\n\nQuestion: What Mascot has an Enrollment greater than 2,464?"
},
{
"role": "assistant",
"content": "SELECT \"mascot\" FROM \"current_members\" WHERE \"enrollment\">'2,464';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004\" (\n \"tournament\" text,\n \"winner\" text,\n \"runner_up\" text,\n \"score\" text,\n \"third_place\" text\n);\n\nQuestion: Who was the runner-up in the tournament in which Omar Camporese held third place?"
},
{
"role": "assistant",
"content": "SELECT \"runner_up\" FROM \"2004\" WHERE \"third_place\"='omar camporese';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004\" (\n \"tournament\" text,\n \"winner\" text,\n \"runner_up\" text,\n \"score\" text,\n \"third_place\" text\n);\n\nQuestion: Who was the runner-up in the tournament in London?"
},
{
"role": "assistant",
"content": "SELECT \"runner_up\" FROM \"2004\" WHERE \"tournament\"='london';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004\" (\n \"tournament\" text,\n \"winner\" text,\n \"runner_up\" text,\n \"score\" text,\n \"third_place\" text\n);\n\nQuestion: What was the score in the tournament in which Michael Stich took third place?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"2004\" WHERE \"third_place\"='michael stich';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004\" (\n \"tournament\" text,\n \"winner\" text,\n \"runner_up\" text,\n \"score\" text,\n \"third_place\" text\n);\n\nQuestion: Who holds third place in the tournament with a score of 2\u20136, 7\u20136(3), [10\u20135]?"
},
{
"role": "assistant",
"content": "SELECT \"third_place\" FROM \"2004\" WHERE \"score\"='2\u20136, 7\u20136(3), [10\u20135]';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the least number of goals for when the goals against is 70 and the ties less than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"goals_for\") FROM \"final_standing\" WHERE \"goals_against\"=70 AND \"ties\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the average losses when the wins is 9 and ties more than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"losses\") FROM \"final_standing\" WHERE \"wins\"=9 AND \"ties\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the lowest number of ties when the losses is 7 and games played is less than 10?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"ties\") FROM \"final_standing\" WHERE \"losses\"=7 AND \"games_played\"<10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the sum of games played when the losses is less than 7, the wins is 6 and the goals for is more than 76?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"games_played\") FROM \"final_standing\" WHERE \"losses\"<7 AND \"wins\"=6 AND \"goals_for\">76;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the total number of games played when the goals for is less than 30?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"games_played\") FROM \"final_standing\" WHERE \"goals_for\"<30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: what is the sum of wins for the ottawa hockey club when the games played is less than 10?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"wins\") FROM \"final_standing\" WHERE \"team\"='ottawa hockey club' AND \"games_played\"<10;"
}
] |
[
{
"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 people attended the game on February 3, 2008?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"february\" WHERE \"date\"='february 3, 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\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 name of the home team that played against Collingwood?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_10\" 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_10\" (\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: Which Away team played at the Windy Hill Venue?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_10\" 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_10\" (\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 large of a crowd can the Glenferrie oval hold?"
},
{
"role": "assistant",
"content": "SELECT \"crowd\" FROM \"round_10\" WHERE \"venue\"='glenferrie oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\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 large of a crowd can the Brunswick Street Oval hold?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_10\" WHERE \"venue\"='brunswick street oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_10\" (\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: Which Home Team had a score of 26.16 (172) and a venue larger than 19,000?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_10\" WHERE \"crowd\">'19,000' AND \"home_team_score\"='26.16 (172)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest number of goals scored by a player in the normal league games where more than 8 total goals were scored?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"league\") FROM \"goalscorers\" WHERE \"total\">8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of goals scored in regular league play by Mustoe where he scored 0 goals in the League Cup?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"league\") FROM \"goalscorers\" WHERE \"name\"='mustoe' AND \"league_cup\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the average number of goals scored in the FA Cup by Whelan where he had more than 7 total goals?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"fa_cup\") FROM \"goalscorers\" WHERE \"name\"='whelan' AND \"total\">7;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest number of goals scored in regular league games by Ehiogu where he scored 0 goals in the FA Cup and at least 1 goal in the League Cup?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"league\") FROM \"goalscorers\" WHERE \"fa_cup\"=0 AND \"total\"=1 AND \"name\"='ehiogu' AND \"league_cup\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"subdivisions\" (\n \"name\" text,\n \"hanzi\" text,\n \"hanyu_pinyin\" text,\n \"uyghur_uey\" text,\n \"uyghur_latin_uly\" text,\n \"population_2010_census\" text,\n \"area_km\" text,\n \"density_km\" text\n);\n\nQuestion: What is the Uyghur Latin with a population of 69,361?"
},
{
"role": "assistant",
"content": "SELECT \"uyghur_latin_uly\" FROM \"subdivisions\" WHERE \"population_2010_census\"='69,361';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"subdivisions\" (\n \"name\" text,\n \"hanzi\" text,\n \"hanyu_pinyin\" text,\n \"uyghur_uey\" text,\n \"uyghur_latin_uly\" text,\n \"population_2010_census\" text,\n \"area_km\" text,\n \"density_km\" text\n);\n\nQuestion: What is the Hanyu Pinyin with an area of 400?"
},
{
"role": "assistant",
"content": "SELECT \"hanyu_pinyin\" FROM \"subdivisions\" WHERE \"area_km\"='400';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"subdivisions\" (\n \"name\" text,\n \"hanzi\" text,\n \"hanyu_pinyin\" text,\n \"uyghur_uey\" text,\n \"uyghur_latin_uly\" text,\n \"population_2010_census\" text,\n \"area_km\" text,\n \"density_km\" text\n);\n\nQuestion: What is the Hanyu Pinyin with a density of 39.63?"
},
{
"role": "assistant",
"content": "SELECT \"hanyu_pinyin\" FROM \"subdivisions\" WHERE \"density_km\"='39.63';"
}
] |
[
{
"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 people were in attendance when the visiting team was the Nuggets and the leading scorer was J.R. Smith (28)?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"february\" WHERE \"visitor\"='nuggets' AND \"leading_scorer\"='j.r. smith (28)';"
}
] |
[
{
"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: Who was the leading scorer on 23 February 2008?"
},
{
"role": "assistant",
"content": "SELECT \"leading_scorer\" FROM \"february\" WHERE \"date\"='23 february 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"nominated_for\" text,\n \"award\" text,\n \"category\" text,\n \"result\" text\n);\n\nQuestion: Name what was nominated in years before 2002 for most popular comedy performer at the national television awards"
},
{
"role": "assistant",
"content": "SELECT \"nominated_for\" FROM \"awards_and_nominations\" WHERE \"year\"<2002 AND \"award\"='national television awards' AND \"category\"='most popular comedy performer';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"nominated_for\" text,\n \"award\" text,\n \"category\" text,\n \"result\" text\n);\n\nQuestion: Name the result for the bafta tv awards"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"awards_and_nominations\" WHERE \"award\"='bafta tv awards';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"nominated_for\" text,\n \"award\" text,\n \"category\" text,\n \"result\" text\n);\n\nQuestion: Name the category for nominated at the british comedy awards"
},
{
"role": "assistant",
"content": "SELECT \"category\" FROM \"awards_and_nominations\" WHERE \"result\"='nominated' AND \"award\"='british comedy awards';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"nominated_for\" text,\n \"award\" text,\n \"category\" text,\n \"result\" text\n);\n\nQuestion: Name the year that Birds of a feather category for most popular actress was nominated"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"awards_and_nominations\" WHERE \"category\"='most popular actress' AND \"nominated_for\"='birds of a feather';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"non_championship_race_results\" (\n \"race_name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: What dates did Ferrari win races?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"non_championship_race_results\" WHERE \"constructor\"='ferrari';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_4_1995_1996\" (\n \"no_in_series\" real,\n \"no_in_season\" real,\n \"title\" text,\n \"director\" text,\n \"writer_s\" text,\n \"original_air_date\" text,\n \"production_code\" text\n);\n\nQuestion: What was the original air date of the episode with production code 2395120?"
},
{
"role": "assistant",
"content": "SELECT \"original_air_date\" FROM \"season_4_1995_1996\" WHERE \"production_code\"='2395120';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"formula_one_world_championship_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"pts\" real\n);\n\nQuestion: How many points for the ferrari v12 engine and ferrari 1512 chassis, after 1965?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"pts\") FROM \"formula_one_world_championship_results\" WHERE \"engine\"='ferrari v12' AND \"chassis\"='ferrari 1512' AND \"year\">1965;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 score for the away team when the home team scored 31.9 (195)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_18\" WHERE \"home_team_score\"='31.9 (195)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 date when the crowd was larger than 30,495?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"round_18\" WHERE \"crowd\">'30,495';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 when Carlton was the away team?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_18\" WHERE \"away_team\"='carlton';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 score for the away team when they played at lake oval?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_18\" 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_18\" (\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 were in the crowd when the home team scored 31.9 (195)?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"crowd\") FROM \"round_18\" WHERE \"home_team_score\"='31.9 (195)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_18\" (\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 score of the away team when hawthorn was the home team?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_18\" WHERE \"home_team\"='hawthorn';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_count\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many golds for nations ranked below 4, over 5 medals, and under 6 silvers?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"gold\") FROM \"medal_count\" WHERE \"rank\">4 AND \"total\">5 AND \"silver\"<6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"snp_targets\" (\n \"rank\" real,\n \"constituency\" text,\n \"winning_party_2003\" text,\n \"swing_to_gain\" real,\n \"snp_s_place_2003\" text,\n \"result\" text\n);\n\nQuestion: Which rank had the Labour party winning in 2003, a swing to gain that was larger than 2.13, a lab hold as a result, and which took place in the Linlithgow constituency?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"snp_targets\" WHERE \"winning_party_2003\"='labour' AND \"swing_to_gain\">2.13 AND \"result\"='lab hold' AND \"constituency\"='linlithgow';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"snp_targets\" (\n \"rank\" real,\n \"constituency\" text,\n \"winning_party_2003\" text,\n \"swing_to_gain\" real,\n \"snp_s_place_2003\" text,\n \"result\" text\n);\n\nQuestion: Which party won in 2003, that had a swing to gain of less than 2.92 and which resulted in a ld hold?"
},
{
"role": "assistant",
"content": "SELECT \"winning_party_2003\" FROM \"snp_targets\" WHERE \"swing_to_gain\"<2.92 AND \"result\"='ld hold';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"snp_targets\" (\n \"rank\" real,\n \"constituency\" text,\n \"winning_party_2003\" text,\n \"swing_to_gain\" real,\n \"snp_s_place_2003\" text,\n \"result\" text\n);\n\nQuestion: Which constituency had the conservative party win in 2003?"
},
{
"role": "assistant",
"content": "SELECT \"constituency\" FROM \"snp_targets\" WHERE \"winning_party_2003\"='conservative';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"date\" text,\n \"visiting_team\" text,\n \"final_score\" text,\n \"host_team\" text,\n \"stadium\" text\n);\n\nQuestion: What is the final score when the visiting team is the Washington Redskins and the date is September 4?"
},
{
"role": "assistant",
"content": "SELECT \"final_score\" FROM \"2008\" WHERE \"visiting_team\"='washington redskins' AND \"date\"='september 4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"date\" text,\n \"visiting_team\" text,\n \"final_score\" text,\n \"host_team\" text,\n \"stadium\" text\n);\n\nQuestion: What is the stadium when the date of the game is December 14?"
},
{
"role": "assistant",
"content": "SELECT \"stadium\" FROM \"2008\" WHERE \"date\"='december 14';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"date\" text,\n \"visiting_team\" text,\n \"final_score\" text,\n \"host_team\" text,\n \"stadium\" text\n);\n\nQuestion: What is the name of the stadium when the visiting team is the Denver Broncos?"
},
{
"role": "assistant",
"content": "SELECT \"stadium\" FROM \"2008\" WHERE \"visiting_team\"='denver broncos';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_11\" (\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 smallest crowd when Melbourne was the away team?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_11\" 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_11\" (\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 largest crowd when the away team scored 2.19 (31)?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"crowd\") FROM \"round_11\" WHERE \"away_team_score\"='2.19 (31)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"uefa_europa_league\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"club\" text,\n \"home\" text,\n \"away\" text,\n \"aggregate\" text\n);\n\nQuestion: What is the Away when the Club is Neath?"
},
{
"role": "assistant",
"content": "SELECT \"away\" FROM \"uefa_europa_league\" WHERE \"club\"='neath';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"measurements\" (\n \"area_in_m\" text,\n \"completion\" text,\n \"city\" text,\n \"country\" text,\n \"denomination\" text\n);\n\nQuestion: What country has area of 7,914 m\u00b2?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"measurements\" WHERE \"area_in_m\"='7,914';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"measurements\" (\n \"area_in_m\" text,\n \"completion\" text,\n \"city\" text,\n \"country\" text,\n \"denomination\" text\n);\n\nQuestion: What city was completed in 1910-1978?"
},
{
"role": "assistant",
"content": "SELECT \"city\" FROM \"measurements\" WHERE \"completion\"='1910-1978';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"measurements\" (\n \"area_in_m\" text,\n \"completion\" text,\n \"city\" text,\n \"country\" text,\n \"denomination\" text\n);\n\nQuestion: What is the country with area of 3,170 in m\u00b2?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"measurements\" WHERE \"area_in_m\"='3,170';"
}
] |
[
{
"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\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: I want the time/retired for grid of 17"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"grid\"=17;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Name the opponent when the field is mitchel athletic complex"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"field\"='mitchel athletic complex';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Name the date for when the home/away is away and the opponent is bayhawks"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"home_away\"='away' AND \"opponent\"='bayhawks';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Say the field with a result of w 12-11"
},
{
"role": "assistant",
"content": "SELECT \"field\" FROM \"schedule\" WHERE \"result\"='w 12-11';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Name the opponent when the result is w 16-15 and has home/away of home"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"home_away\"='home' AND \"result\"='w 16-15';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Name the opponent when the resultwas w 12-11"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"result\"='w 12-11';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"date\" text,\n \"opponent\" text,\n \"home_away\" text,\n \"field\" text,\n \"result\" text\n);\n\nQuestion: Name the opponent which has a home/away of home and date of july 27"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"home_away\"='home' AND \"date\"='july 27';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_8\" (\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: I want to know the home team for mcg venue"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_8\" WHERE \"venue\"='mcg';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"out\" (\n \"name\" text,\n \"country\" text,\n \"status\" text,\n \"moving_to\" text,\n \"transfer_fee\" text\n);\n\nQuestion: Where did Konchesky move to?"
},
{
"role": "assistant",
"content": "SELECT \"moving_to\" FROM \"out\" WHERE \"name\"='konchesky';"
}
] |
[
{
"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: Who is Essendon's home team?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"crowd\") FROM \"round_9\" WHERE \"home_team\"='essendon';"
}
] |
[
{
"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 is the away team score for North Melbourne's home team?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_9\" WHERE \"away_team\"='north melbourne';"
}
] |
[
{
"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 is Geelong's home team score?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_9\" WHERE \"home_team\"='geelong';"
}
] |
[
{
"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 is the home team score for St Kilda's home team?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_9\" WHERE \"home_team\"='st kilda';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"grid\" real,\n \"driver\" text,\n \"constructor\" text,\n \"qual\" real,\n \"rank\" real,\n \"laps\" real,\n \"time_retired\" text\n);\n\nQuestion: Who was #16 rank constructor with a grid of more than 1?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"classification\" WHERE \"grid\">1 AND \"rank\"=16;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"grid\" real,\n \"driver\" text,\n \"constructor\" text,\n \"qual\" real,\n \"rank\" real,\n \"laps\" real,\n \"time_retired\" text\n);\n\nQuestion: Who constructed Joe James car when his rank was more than 10?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"classification\" WHERE \"rank\">10 AND \"driver\"='joe james';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"grid\" real,\n \"driver\" text,\n \"constructor\" text,\n \"qual\" real,\n \"rank\" real,\n \"laps\" real,\n \"time_retired\" text\n);\n\nQuestion: What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more than 134.14 and a time/retired of +14:21.72?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"rank\") FROM \"classification\" WHERE \"laps\">182 AND \"qual\">134.14 AND \"time_retired\"='+14:21.72' AND \"grid\"<3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"grid\" real,\n \"driver\" text,\n \"constructor\" text,\n \"qual\" real,\n \"rank\" real,\n \"laps\" real,\n \"time_retired\" text\n);\n\nQuestion: How many laps did Chuck Stevenson have with a grid of less than 11?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"laps\") FROM \"classification\" WHERE \"driver\"='chuck stevenson' AND \"grid\"<11;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: Which Week has an Opponent of san francisco 49ers?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"week\") FROM \"schedule\" WHERE \"opponent\"='san francisco 49ers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"middleweight_77_kg\" (\n \"name\" text,\n \"bodyweight\" real,\n \"snatch\" real,\n \"clean_jerk\" text,\n \"total_kg\" text\n);\n\nQuestion: What is the snatch for the Clean & jerk of 145.0, and a Bodyweight larger than 76.22?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"snatch\") FROM \"middleweight_77_kg\" WHERE \"clean_jerk\"='145.0' AND \"bodyweight\">76.22;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"middleweight_77_kg\" (\n \"name\" text,\n \"bodyweight\" real,\n \"snatch\" real,\n \"clean_jerk\" text,\n \"total_kg\" text\n);\n\nQuestion: What is the Clean & jerk for the snatch less than 150 and a Bodyweight of 76.18?"
},
{
"role": "assistant",
"content": "SELECT \"clean_jerk\" FROM \"middleweight_77_kg\" WHERE \"snatch\"<150 AND \"bodyweight\"=76.18;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"middleweight_77_kg\" (\n \"name\" text,\n \"bodyweight\" real,\n \"snatch\" real,\n \"clean_jerk\" text,\n \"total_kg\" text\n);\n\nQuestion: What is the least Bodyweight for the Clean & jerk of 145.0, and a Snatch smaller than 122.5?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"bodyweight\") FROM \"middleweight_77_kg\" WHERE \"clean_jerk\"='145.0' AND \"snatch\"<122.5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"middleweight_77_kg\" (\n \"name\" text,\n \"bodyweight\" real,\n \"snatch\" real,\n \"clean_jerk\" text,\n \"total_kg\" text\n);\n\nQuestion: What is the Clean & jerk for the bodyweight less than 76.55, and the Total (kg) of \u2013?"
},
{
"role": "assistant",
"content": "SELECT \"clean_jerk\" FROM \"middleweight_77_kg\" WHERE \"bodyweight\"<76.55 AND \"total_kg\"='\u2013';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2003_broadway_revival\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: What was the latest year that resulted in won?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"2003_broadway_revival\" WHERE \"result\"='won';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"selections\" (\n \"draft\" text,\n \"round\" real,\n \"pick\" real,\n \"nationality\" text,\n \"position\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which position had a pick of 50?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"selections\" WHERE \"pick\"=50;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"selections\" (\n \"draft\" text,\n \"round\" real,\n \"pick\" real,\n \"nationality\" text,\n \"position\" text,\n \"school_club_team\" text\n);\n\nQuestion: Which team had a 2008-3 2008 draft?"
},
{
"role": "assistant",
"content": "SELECT \"school_club_team\" FROM \"selections\" WHERE \"draft\"='2008-3 2008';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"selections\" (\n \"draft\" text,\n \"round\" real,\n \"pick\" real,\n \"nationality\" text,\n \"position\" text,\n \"school_club_team\" text\n);\n\nQuestion: What is the average pick after Round 2?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"pick\") FROM \"selections\" WHERE \"round\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1990s\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What is the date of the game with a loss result in the Europe/Africa Group I, Round Robin competition in Murcia (esp) after 1998?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"1990s\" WHERE \"result\"='loss' AND \"competition\"='europe/africa group i, round robin' AND \"location\"='murcia (esp)' AND \"year\">1998;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1990s\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What is the result of the Europe/Africa Group I, play-off competition?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"1990s\" WHERE \"competition\"='europe/africa group i, play-off';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1990s\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What is the result of the europe/africa group i, round robin game in Murcia (esp) before 1999?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"1990s\" WHERE \"location\"='murcia (esp)' AND \"year\"<1999 AND \"competition\"='europe/africa group i, round robin';"
}
] |
[
{
"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 position did the person from Clemson school fill?"
},
{
"role": "assistant",
"content": "SELECT \"position\" FROM \"nfl_draft\" WHERE \"school\"='clemson';"
}
] |
[
{
"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 was Rudy Harris' pick number in round 4?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"pick\") FROM \"nfl_draft\" WHERE \"round\"='round 4' AND \"player\"='rudy harris';"
}
] |
[
{
"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 was the pick number for the kicker in round 8?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"pick\") FROM \"nfl_draft\" WHERE \"round\"='round 8' AND \"position\"='kicker';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"history\" (\n \"year\" real,\n \"western_champion\" text,\n \"result\" text,\n \"eastern_champion\" text,\n \"finals_mvp\" text\n);\n\nQuestion: What is the result from 2013?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"history\" WHERE \"year\"=2013;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"history\" (\n \"year\" real,\n \"western_champion\" text,\n \"result\" text,\n \"eastern_champion\" text,\n \"finals_mvp\" text\n);\n\nQuestion: Who is the MVP finals that includes Detroit shock from the eastern championship and Sacramento monarchs from western championship?"
},
{
"role": "assistant",
"content": "SELECT \"finals_mvp\" FROM \"history\" WHERE \"eastern_champion\"='detroit shock' AND \"western_champion\"='sacramento monarchs';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.