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 \"complete_formula_one_results\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: Which year has a total of 0 points and a chassis of Toleman tg181?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"complete_formula_one_results\" WHERE \"points\"=0 AND \"chassis\"='toleman tg181';"
}
] |
[
{
"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 \"points\" real\n);\n\nQuestion: What is the latest year that has more than 5 points and a renault ef15 1.5 v6 t engine?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"complete_formula_one_results\" WHERE \"engine\"='renault ef15 1.5 v6 t' AND \"points\">5;"
}
] |
[
{
"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 \"points\" real\n);\n\nQuestion: Which year had a toleman tg183 chassis?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"complete_formula_one_results\" WHERE \"chassis\"='toleman tg183';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"junior_classic_race\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"speed\" text,\n \"time\" text\n);\n\nQuestion: What is the time for tony myres?"
},
{
"role": "assistant",
"content": "SELECT \"time\" FROM \"junior_classic_race\" WHERE \"rider\"='tony myres';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"junior_classic_race\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"speed\" text,\n \"time\" text\n);\n\nQuestion: Name the speed for andy reynolds"
},
{
"role": "assistant",
"content": "SELECT \"speed\" FROM \"junior_classic_race\" WHERE \"rider\"='andy reynolds';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"junior_classic_race\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"speed\" text,\n \"time\" text\n);\n\nQuestion: Name the total number of rank for 348cc petty manx"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"rank\") FROM \"junior_classic_race\" WHERE \"team\"='348cc petty manx';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"junior_classic_race\" (\n \"rank\" real,\n \"rider\" text,\n \"team\" text,\n \"speed\" text,\n \"time\" text\n);\n\nQuestion: Name the speed for 1:36.46.93"
},
{
"role": "assistant",
"content": "SELECT \"speed\" FROM \"junior_classic_race\" WHERE \"time\"='1:36.46.93';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_6\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the away team score of Melbourne?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_6\" 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_6\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the away team score for South Melbourne?"
},
{
"role": "assistant",
"content": "SELECT \"away_team_score\" FROM \"round_6\" WHERE \"away_team\"='south melbourne';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_6\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What away team has a score of 12.10 (82)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_6\" WHERE \"away_team_score\"='12.10 (82)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"c_liners\" (\n \"model\" text,\n \"build_year\" text,\n \"total_produced\" real,\n \"wheel_arrangement\" text,\n \"prime_mover\" text,\n \"power_output\" text\n);\n\nQuestion: What is Prime Mover of Model FM CFA-16-4?"
},
{
"role": "assistant",
"content": "SELECT \"prime_mover\" FROM \"c_liners\" WHERE \"model\"='fm cfa-16-4';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournament_results\" (\n \"date\" text,\n \"tournament\" text,\n \"location\" text,\n \"purse\" real,\n \"winner\" text,\n \"score\" text,\n \"1st_prize\" real\n);\n\nQuestion: with a 1st prize larger than 315,000 what was the score?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"tournament_results\" WHERE \"1st_prize\">'315,000';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournament_results\" (\n \"date\" text,\n \"tournament\" text,\n \"location\" text,\n \"purse\" real,\n \"winner\" text,\n \"score\" text,\n \"1st_prize\" real\n);\n\nQuestion: what was the purse ($) in illinois?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"purse\") FROM \"tournament_results\" WHERE \"location\"='illinois';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tournament_results\" (\n \"date\" text,\n \"tournament\" text,\n \"location\" text,\n \"purse\" real,\n \"winner\" text,\n \"score\" text,\n \"1st_prize\" real\n);\n\nQuestion: who won with a score of 199 (-14) on oct 31?"
},
{
"role": "assistant",
"content": "SELECT \"winner\" FROM \"tournament_results\" WHERE \"score\"='199 (-14)' AND \"date\"='oct 31';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"spanish_national_championship\" (\n \"city\" text,\n \"position\" real,\n \"event\" text,\n \"year\" real,\n \"score\" text\n);\n\nQuestion: How many years did he play in santiago de compostela?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"spanish_national_championship\" WHERE \"city\"='santiago de compostela';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_rating_drama_series_of_2006\" (\n \"rank\" real,\n \"english_title\" text,\n \"chinese_title\" text,\n \"average\" real,\n \"peak\" real,\n \"premiere\" real,\n \"finale\" real,\n \"hk_viewers\" text\n);\n\nQuestion: What is the Total Finale of \u5973\u4eba\u5514\u6613\u505a?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"finale\") FROM \"highest_rating_drama_series_of_2006\" WHERE \"chinese_title\"='\u5973\u4eba\u5514\u6613\u505a';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_rating_drama_series_of_2006\" (\n \"rank\" real,\n \"english_title\" text,\n \"chinese_title\" text,\n \"average\" real,\n \"peak\" real,\n \"premiere\" real,\n \"finale\" real,\n \"hk_viewers\" text\n);\n\nQuestion: What is the lowest Premiere peaking at more than 35 with a Rank of 10 and Finale greater than 33?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"premiere\") FROM \"highest_rating_drama_series_of_2006\" WHERE \"peak\">35 AND \"rank\"=10 AND \"finale\">33;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_rating_drama_series_of_2006\" (\n \"rank\" real,\n \"english_title\" text,\n \"chinese_title\" text,\n \"average\" real,\n \"peak\" real,\n \"premiere\" real,\n \"finale\" real,\n \"hk_viewers\" text\n);\n\nQuestion: What is the Chinese Title Premiering 32 with 2.07 million HK viewers?"
},
{
"role": "assistant",
"content": "SELECT \"chinese_title\" FROM \"highest_rating_drama_series_of_2006\" WHERE \"hk_viewers\"='2.07 million' AND \"premiere\"=32;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_rating_drama_series_of_2006\" (\n \"rank\" real,\n \"english_title\" text,\n \"chinese_title\" text,\n \"average\" real,\n \"peak\" real,\n \"premiere\" real,\n \"finale\" real,\n \"hk_viewers\" text\n);\n\nQuestion: What is the Average of Men in Pain with a Finale of less than 33?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"average\") FROM \"highest_rating_drama_series_of_2006\" WHERE \"english_title\"='men in pain' AND \"finale\"<33;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"highest_rating_drama_series_of_2006\" (\n \"rank\" real,\n \"english_title\" text,\n \"chinese_title\" text,\n \"average\" real,\n \"peak\" real,\n \"premiere\" real,\n \"finale\" real,\n \"hk_viewers\" text\n);\n\nQuestion: What Chinese Title Ranking #7 has an Average of 32 and Peak less than 38?"
},
{
"role": "assistant",
"content": "SELECT \"chinese_title\" FROM \"highest_rating_drama_series_of_2006\" WHERE \"average\"=32 AND \"peak\"<38 AND \"rank\"=7;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 has a score of 17.4 (106)?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"round_1\" WHERE \"away_team_score\"='17.4 (106)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 average crowd size for corio oval?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crowd\") FROM \"round_1\" WHERE \"venue\"='corio oval';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_1\" (\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 average crowd size for Brunswick street oval?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"crowd\") FROM \"round_1\" 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 \"1990_1999\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What day did the team play in murcia with a score of 0-3 after 1992?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"1990_1999\" WHERE \"year\">1992 AND \"location\"='murcia' AND \"score\"='0-3';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1990_1999\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What location did the team win before 1998 in the europe/africa zone, group i, round robin?"
},
{
"role": "assistant",
"content": "SELECT \"location\" FROM \"1990_1999\" WHERE \"competition\"='europe/africa zone, group i, round robin' AND \"result\"='win' AND \"year\"<1998;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1990_1999\" (\n \"year\" real,\n \"competition\" text,\n \"date\" text,\n \"location\" text,\n \"score\" text,\n \"result\" text\n);\n\nQuestion: What day did they record a score of 1-2 in 1994?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"1990_1999\" WHERE \"score\"='1-2' AND \"year\"=1994;"
}
] |
[
{
"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: Who was the opponent on November 5, 1944 with more than 24,123 people to watch?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"attendance\">'24,123' AND \"date\"='november 5, 1944';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"all_matches\" (\n \"rank\" real,\n \"name\" text,\n \"country\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: When the country is austria germany and the rank is kept under 5, what's the average number of matches played?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"matches\") FROM \"all_matches\" WHERE \"country\"='austria germany' AND \"rank\"<5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"all_matches\" (\n \"rank\" real,\n \"name\" text,\n \"country\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: Which country does the player pele belong to?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"all_matches\" WHERE \"name\"='pele';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"game\" real,\n \"date\" text,\n \"score\" text,\n \"location\" text,\n \"time\" text,\n \"attendance\" real\n);\n\nQuestion: What is the earliest game that had 42,707 attending?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"game\") FROM \"summary\" WHERE \"attendance\"='42,707';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"placings\" text,\n \"figures\" real,\n \"free\" real,\n \"total\" real\n);\n\nQuestion: What is the sum of the figure skating scores whose total is less than 117.78?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"figures\") FROM \"ladies\" WHERE \"total\"<117.78;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"placings\" text,\n \"figures\" real,\n \"free\" real,\n \"total\" real\n);\n\nQuestion: What is the lowest total score among skaters from West Germany with a rank of 20 and a figure skating score less than 74.85?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"total\") FROM \"ladies\" WHERE \"nation\"='west germany' AND \"rank\"=20 AND \"figures\"<74.85;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"ladies\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"placings\" text,\n \"figures\" real,\n \"free\" real,\n \"total\" real\n);\n\nQuestion: How many placings did Jacqueline du Bief earn where her total score is greater than 131.26?"
},
{
"role": "assistant",
"content": "SELECT \"placings\" FROM \"ladies\" WHERE \"total\">131.26 AND \"name\"='jacqueline du bief';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"placings\" real,\n \"figures\" real,\n \"free\" real,\n \"total\" real\n);\n\nQuestion: Can you tell me the Placings that hasthe Free smaller than 524.3, and the Total smaller than 1170.1, and the Name of per cock-clausen?"
},
{
"role": "assistant",
"content": "SELECT \"placings\" FROM \"men\" WHERE \"free\"<524.3 AND \"total\"<1170.1 AND \"name\"='per cock-clausen';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"rank\" real,\n \"name\" text,\n \"nation\" text,\n \"placings\" real,\n \"figures\" real,\n \"free\" real,\n \"total\" real\n);\n\nQuestion: Can you tell me the average Figures that has the Placings of 34, and the Total larger than 1247.51?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"figures\") FROM \"men\" WHERE \"placings\"=34 AND \"total\">1247.51;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season_schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"home_away_game\" text,\n \"result\" text\n);\n\nQuestion: What is the result where the opponent is Columbus Destroyers?"
},
{
"role": "assistant",
"content": "SELECT \"result\" FROM \"regular_season_schedule\" WHERE \"opponent\"='columbus destroyers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season_schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"home_away_game\" text,\n \"result\" text\n);\n\nQuestion: What is the date of the away game in week 8?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"regular_season_schedule\" WHERE \"home_away_game\"='away' AND \"week\"=8;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"grands_prix\" (\n \"round\" real,\n \"grand_prix\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: Which grand prix had gerhard berger in his fastest lap and a jacques villeneuve pole position?"
},
{
"role": "assistant",
"content": "SELECT \"grand_prix\" FROM \"grands_prix\" WHERE \"fastest_lap\"='gerhard berger' AND \"pole_position\"='jacques villeneuve';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"councils\" (\n \"council\" text,\n \"2003_result\" text,\n \"notional_control_based_on_2003_results\" text,\n \"2007_result\" text,\n \"details\" text\n);\n\nQuestion: Which council has a notional control of noc and a 2007 result of no overall control (snp + ld)?"
},
{
"role": "assistant",
"content": "SELECT \"council\" FROM \"councils\" WHERE \"notional_control_based_on_2003_results\"='noc' AND \"2007_result\"='no overall control (snp + ld)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"councils\" (\n \"council\" text,\n \"2003_result\" text,\n \"notional_control_based_on_2003_results\" text,\n \"2007_result\" text,\n \"details\" text\n);\n\nQuestion: What's the 2007 result when the notional control is noc?"
},
{
"role": "assistant",
"content": "SELECT \"2007_result\" FROM \"councils\" WHERE \"notional_control_based_on_2003_results\"='noc';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"councils\" (\n \"council\" text,\n \"2003_result\" text,\n \"notional_control_based_on_2003_results\" text,\n \"2007_result\" text,\n \"details\" text\n);\n\nQuestion: What's the 2003 result for the falkirk council?"
},
{
"role": "assistant",
"content": "SELECT \"2003_result\" FROM \"councils\" WHERE \"council\"='falkirk';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"councils\" (\n \"council\" text,\n \"2003_result\" text,\n \"notional_control_based_on_2003_results\" text,\n \"2007_result\" text,\n \"details\" text\n);\n\nQuestion: What council has a 2007 result of no overall control (ind + snp)?"
},
{
"role": "assistant",
"content": "SELECT \"council\" FROM \"councils\" WHERE \"2007_result\"='no overall control (ind + snp)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"councils\" (\n \"council\" text,\n \"2003_result\" text,\n \"notional_control_based_on_2003_results\" text,\n \"2007_result\" text,\n \"details\" text\n);\n\nQuestion: What's the 2007 result when the notional control is noc and the 2003 result is snp?"
},
{
"role": "assistant",
"content": "SELECT \"2007_result\" FROM \"councils\" WHERE \"notional_control_based_on_2003_results\"='noc' AND \"2003_result\"='snp';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: On which date was the manager fired and replaced by Albert Cartier?"
},
{
"role": "assistant",
"content": "SELECT \"date_of_vacancy\" FROM \"managerial_changes\" WHERE \"manner_of_departure\"='fired' AND \"replaced_by\"='albert cartier';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: What was the manner of departure for the team Anderlecht?"
},
{
"role": "assistant",
"content": "SELECT \"manner_of_departure\" FROM \"managerial_changes\" WHERE \"team\"='anderlecht';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: What was the manner of depature when the date of appointment was 27 December 2007?"
},
{
"role": "assistant",
"content": "SELECT \"manner_of_departure\" FROM \"managerial_changes\" WHERE \"date_of_appointment\"='27 december 2007';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: Who was the replacement for the Brussels team with a date of vacancy of 22 December 2007?"
},
{
"role": "assistant",
"content": "SELECT \"replaced_by\" FROM \"managerial_changes\" WHERE \"team\"='brussels' AND \"date_of_vacancy\"='22 december 2007';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"manner_of_departure\" text,\n \"date_of_vacancy\" text,\n \"replaced_by\" text,\n \"date_of_appointment\" text\n);\n\nQuestion: What was the date of vacancy where the replacement was Albert Cartier and the manager was fired?"
},
{
"role": "assistant",
"content": "SELECT \"date_of_vacancy\" FROM \"managerial_changes\" WHERE \"manner_of_departure\"='fired' AND \"replaced_by\"='albert cartier';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"tallangatta_dfl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the Tallangatta DFL losses greater than 2 and an against greater than 1013"
},
{
"role": "assistant",
"content": "SELECT \"tallangatta_dfl\" FROM \"2009_ladder\" WHERE \"against\">1013 AND \"losses\">2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"tallangatta_dfl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What are the average byes that are greater than 1479, wins greater than 5 and 0 draws?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"byes\") FROM \"2009_ladder\" WHERE \"against\">1479 AND \"wins\">5 AND \"draws\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" real,\n \"name\" text,\n \"height_m_ft\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: Tell me the average year for rank more than 3 and 28 floors"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year\") FROM \"tallest_buildings\" WHERE \"rank\">3 AND \"floors\"=28;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"tallest_buildings\" (\n \"rank\" real,\n \"name\" text,\n \"height_m_ft\" text,\n \"floors\" real,\n \"year\" real\n);\n\nQuestion: I want the name for rank less than 6 and year more than 1974"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"tallest_buildings\" WHERE \"rank\"<6 AND \"year\">1974;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nations\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average rank of Great Britain when their total is over 4?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"nations\" WHERE \"total\">4 AND \"nation\"='great britain';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"nations\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total number of Silvers held by France when their rank was over 14?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"silver\") FROM \"nations\" WHERE \"nation\"='france' AND \"rank\">14;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_20\" (\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 was the home team at the game held at Princes Park?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_20\" WHERE \"venue\"='princes park';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_20\" (\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 was the home team when the away team scored 18.18 (126)?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_20\" WHERE \"away_team_score\"='18.18 (126)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_20\" (\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 was the home team when Hawthorn was the away team?"
},
{
"role": "assistant",
"content": "SELECT \"home_team\" FROM \"round_20\" WHERE \"away_team\"='hawthorn';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the Rockies record at their game that had a loss of Hernandez (3\u20135)?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"loss\"='hernandez (3\u20135)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers_and_constructors\" (\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: What engine has g tyres and is driven by elio de angelis?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"drivers_and_constructors\" WHERE \"tyres\"='g' AND \"driver\"='elio de angelis';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers_and_constructors\" (\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: What rounds does elio de angelis drive?"
},
{
"role": "assistant",
"content": "SELECT \"rounds\" FROM \"drivers_and_constructors\" WHERE \"driver\"='elio de angelis';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers_and_constructors\" (\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: Who is the constructor for driver alan jones using a chassis of fw06 fw07?"
},
{
"role": "assistant",
"content": "SELECT \"constructor\" FROM \"drivers_and_constructors\" WHERE \"chassis\"='fw06 fw07' AND \"driver\"='alan jones';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers_and_constructors\" (\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: What engine does driver james hunt have?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"drivers_and_constructors\" WHERE \"driver\"='james hunt';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"drivers_and_constructors\" (\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: What's the engine used for rounds 5-6?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"drivers_and_constructors\" WHERE \"rounds\"='5-6';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_4\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who was the home team at Princes Park?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_4\" WHERE \"venue\"='princes park';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"race_calendar\" (\n \"date\" text,\n \"series\" text,\n \"circuit\" text,\n \"city_state\" text,\n \"winner\" text,\n \"team\" text\n);\n\nQuestion: Tell me the city/state for the holden racing team with winner of mark skaife todd kelly"
},
{
"role": "assistant",
"content": "SELECT \"city_state\" FROM \"race_calendar\" WHERE \"team\"='holden racing team' AND \"winner\"='mark skaife todd kelly';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"engine_specifications\" (\n \"engine_name\" text,\n \"engine_configuration\" text,\n \"displacement\" text,\n \"max_power_at_rpm\" text,\n \"max_torque_at_rpm\" text\n);\n\nQuestion: What is the engine configuration of the 1.2 mpi engine?"
},
{
"role": "assistant",
"content": "SELECT \"engine_configuration\" FROM \"engine_specifications\" WHERE \"engine_name\"='1.2 mpi';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"engine_specifications\" (\n \"engine_name\" text,\n \"engine_configuration\" text,\n \"displacement\" text,\n \"max_power_at_rpm\" text,\n \"max_torque_at_rpm\" text\n);\n\nQuestion: What is the max torque of the 1.2 mpi engine?"
},
{
"role": "assistant",
"content": "SELECT \"max_torque_at_rpm\" FROM \"engine_specifications\" WHERE \"engine_name\"='1.2 mpi';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"car\" real,\n \"yards\" text,\n \"avg\" text,\n \"td_s\" real,\n \"long\" text\n);\n\nQuestion: Tell me the long for TD's of 4"
},
{
"role": "assistant",
"content": "SELECT \"long\" FROM \"rushing\" WHERE \"td_s\"=4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"car\" real,\n \"yards\" text,\n \"avg\" text,\n \"td_s\" real,\n \"long\" text\n);\n\nQuestion: Tell me the long for charles frederick"
},
{
"role": "assistant",
"content": "SELECT \"long\" FROM \"rushing\" WHERE \"player\"='charles frederick';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"car\" real,\n \"yards\" text,\n \"avg\" text,\n \"td_s\" real,\n \"long\" text\n);\n\nQuestion: Tell me the average for 1 yards"
},
{
"role": "assistant",
"content": "SELECT \"avg\" FROM \"rushing\" WHERE \"yards\"='1';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rushing\" (\n \"player\" text,\n \"car\" real,\n \"yards\" text,\n \"avg\" text,\n \"td_s\" real,\n \"long\" text\n);\n\nQuestion: Tell me the sum of TD's for 4 avg."
},
{
"role": "assistant",
"content": "SELECT SUM(\"td_s\") FROM \"rushing\" WHERE \"avg\"='4';"
}
] |
[
{
"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: Which time/retired had 75 laps and Pedro de la Rosa as a driver?"
},
{
"role": "assistant",
"content": "SELECT \"time_retired\" FROM \"race\" WHERE \"laps\"=75 AND \"driver\"='pedro de la rosa';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_2\" (\n \"no_in_series\" real,\n \"no_in_season\" real,\n \"title\" text,\n \"directed_by\" text,\n \"written_by\" text,\n \"original_air_date\" text\n);\n\nQuestion: What is the total number in the season for the #30 Robert Berlinger series?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"no_in_season\") FROM \"season_2\" WHERE \"directed_by\"='robert berlinger' AND \"no_in_series\"=30;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_2\" (\n \"no_in_series\" real,\n \"no_in_season\" real,\n \"title\" text,\n \"directed_by\" text,\n \"written_by\" text,\n \"original_air_date\" text\n);\n\nQuestion: When did Julie gets Validated originally air?"
},
{
"role": "assistant",
"content": "SELECT \"original_air_date\" FROM \"season_2\" WHERE \"title\"='julie gets validated';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_2\" (\n \"no_in_series\" real,\n \"no_in_season\" real,\n \"title\" text,\n \"directed_by\" text,\n \"written_by\" text,\n \"original_air_date\" text\n);\n\nQuestion: Who was the number 24 series written by?"
},
{
"role": "assistant",
"content": "SELECT \"written_by\" FROM \"season_2\" WHERE \"no_in_series\"=24;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_2\" (\n \"no_in_series\" real,\n \"no_in_season\" real,\n \"title\" text,\n \"directed_by\" text,\n \"written_by\" text,\n \"original_air_date\" text\n);\n\nQuestion: When did Boyd Hale's Julie gets Validated originally air?"
},
{
"role": "assistant",
"content": "SELECT \"original_air_date\" FROM \"season_2\" WHERE \"written_by\"='boyd hale' AND \"title\"='julie gets validated';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1973\" (\n \"1973_democratic_run_off_primary\" text,\n \"manhattan\" text,\n \"the_bronx\" text,\n \"brooklyn\" text,\n \"queens\" text,\n \"richmond_staten_is\" text,\n \"total\" real\n);\n\nQuestion: What was the Queens number when Brooklyn was 201,866?"
},
{
"role": "assistant",
"content": "SELECT \"queens\" FROM \"1973\" WHERE \"brooklyn\"='201,866';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1973\" (\n \"1973_democratic_run_off_primary\" text,\n \"manhattan\" text,\n \"the_bronx\" text,\n \"brooklyn\" text,\n \"queens\" text,\n \"richmond_staten_is\" text,\n \"total\" real\n);\n\nQuestion: Which Queens number in the 1973 Democratic run-off primary involved Herman Badillo and where the Bronx's percentage was 47%?"
},
{
"role": "assistant",
"content": "SELECT \"queens\" FROM \"1973\" WHERE \"1973_democratic_run_off_primary\"='herman badillo' AND \"the_bronx\"='47%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1973\" (\n \"1973_democratic_run_off_primary\" text,\n \"manhattan\" text,\n \"the_bronx\" text,\n \"brooklyn\" text,\n \"queens\" text,\n \"richmond_staten_is\" text,\n \"total\" real\n);\n\nQuestion: Which Manhattan number appeared when Richmond (Staten Island) was 78%?"
},
{
"role": "assistant",
"content": "SELECT \"manhattan\" FROM \"1973\" WHERE \"richmond_staten_is\"='78%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1973\" (\n \"1973_democratic_run_off_primary\" text,\n \"manhattan\" text,\n \"the_bronx\" text,\n \"brooklyn\" text,\n \"queens\" text,\n \"richmond_staten_is\" text,\n \"total\" real\n);\n\nQuestion: Which Manhattan number was there when the Total was bigger than 354,581 and The Bronx's number was 97,415?"
},
{
"role": "assistant",
"content": "SELECT \"manhattan\" FROM \"1973\" WHERE \"total\">'354,581' AND \"the_bronx\"='97,415';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_5\" (\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 did the home team score against Fitzroy?"
},
{
"role": "assistant",
"content": "SELECT \"home_team_score\" FROM \"round_5\" WHERE \"away_team\"='fitzroy';"
}
] |
[
{
"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\" text\n);\n\nQuestion: Who is the listed opponent in Week 2?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"week\"=2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What date has attendance listed as 45,024?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"schedule\" WHERE \"attendance\"='45,024';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_vancouver_canucks_draft_picks\" (\n \"rd_num\" real,\n \"pick_num\" real,\n \"player\" text,\n \"team_league\" text,\n \"reg_gp\" real,\n \"pl_gp\" real\n);\n\nQuestion: What numbered pick was mattias ohlund, with over 52 PL GP, and also a round under 11?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"pick_num\") FROM \"list_of_vancouver_canucks_draft_picks\" WHERE \"rd_num\"<11 AND \"player\"='mattias ohlund' AND \"pl_gp\">52;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_vancouver_canucks_draft_picks\" (\n \"rd_num\" real,\n \"pick_num\" real,\n \"player\" text,\n \"team_league\" text,\n \"reg_gp\" real,\n \"pl_gp\" real\n);\n\nQuestion: How many reg GP for mattias ohlund?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"reg_gp\") FROM \"list_of_vancouver_canucks_draft_picks\" WHERE \"player\"='mattias ohlund';"
}
] |
[
{
"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 is the average attendance against the expos?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"attendance\") FROM \"game_log\" WHERE \"opponent\"='expos';"
}
] |
[
{
"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 is the team's record on april 12?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"date\"='april 12';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Who did the team play on april 19?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"date\"='april 19';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"channel_lineup\" (\n \"channel\" real,\n \"video\" text,\n \"aspect\" text,\n \"psip_short_name\" text,\n \"programming\" text\n);\n\nQuestion: What is the Aspect of Channel 26.5?"
},
{
"role": "assistant",
"content": "SELECT \"aspect\" FROM \"channel_lineup\" WHERE \"channel\"=26.5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"channel_lineup\" (\n \"channel\" real,\n \"video\" text,\n \"aspect\" text,\n \"psip_short_name\" text,\n \"programming\" text\n);\n\nQuestion: Which Programming is on Channel 26.5?"
},
{
"role": "assistant",
"content": "SELECT \"programming\" FROM \"channel_lineup\" WHERE \"channel\"=26.5;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"channel_lineup\" (\n \"channel\" real,\n \"video\" text,\n \"aspect\" text,\n \"psip_short_name\" text,\n \"programming\" text\n);\n\nQuestion: Which Programming is on a channel less than 26.5, has a Video of 480i and a PSIP Short Name of jtv?"
},
{
"role": "assistant",
"content": "SELECT \"programming\" FROM \"channel_lineup\" WHERE \"channel\"<26.5 AND \"video\"='480i' AND \"psip_short_name\"='jtv';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What number of laps were done by driver Ronnie Peterson?"
},
{
"role": "assistant",
"content": "SELECT \"laps\" FROM \"classification\" WHERE \"driver\"='ronnie peterson';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which driver had a time/retired of fuel system?"
},
{
"role": "assistant",
"content": "SELECT \"driver\" FROM \"classification\" WHERE \"time_retired\"='fuel system';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the sum of grids with an engine in Time/Retired with less than 45 laps for Giancarlo Baghetti?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"grid\") FROM \"classification\" WHERE \"time_retired\"='engine' AND \"laps\"<45 AND \"driver\"='giancarlo baghetti';"
}
] |
[
{
"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 Grid for Laps of 35"
},
{
"role": "assistant",
"content": "SELECT \"grid\" FROM \"race\" WHERE \"laps\"=35;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_africa\" (\n \"player\" text,\n \"date_of_birth\" text,\n \"batting_style\" text,\n \"bowling_style\" text,\n \"first_class_team\" text\n);\n\nQuestion: What is Jonty Rhodes's batting style?"
},
{
"role": "assistant",
"content": "SELECT \"batting_style\" FROM \"south_africa\" WHERE \"player\"='jonty rhodes';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_africa\" (\n \"player\" text,\n \"date_of_birth\" text,\n \"batting_style\" text,\n \"bowling_style\" text,\n \"first_class_team\" text\n);\n\nQuestion: What bowling style does First Class Team, Griqualand West have?"
},
{
"role": "assistant",
"content": "SELECT \"bowling_style\" FROM \"south_africa\" WHERE \"first_class_team\"='griqualand west';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"south_africa\" (\n \"player\" text,\n \"date_of_birth\" text,\n \"batting_style\" text,\n \"bowling_style\" text,\n \"first_class_team\" text\n);\n\nQuestion: What is the batting style of Makhaya Ntini?"
},
{
"role": "assistant",
"content": "SELECT \"batting_style\" FROM \"south_africa\" WHERE \"player\"='makhaya ntini';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_and_second_rounds\" (\n \"region\" text,\n \"host\" text,\n \"venue\" text,\n \"city\" text,\n \"state\" text\n);\n\nQuestion: What region is the host university of southern california located?"
},
{
"role": "assistant",
"content": "SELECT \"region\" FROM \"first_and_second_rounds\" WHERE \"host\"='university of southern california';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_and_second_rounds\" (\n \"region\" text,\n \"host\" text,\n \"venue\" text,\n \"city\" text,\n \"state\" text\n);\n\nQuestion: In which state is the city of knoxville?"
},
{
"role": "assistant",
"content": "SELECT \"state\" FROM \"first_and_second_rounds\" WHERE \"city\"='knoxville';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.