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 \"performance_by_nation\" (\n \"rank\" real,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the average total for gold less than 1 and rank less than 5"
},
{
"role": "assistant",
"content": "SELECT AVG(\"total\") FROM \"performance_by_nation\" WHERE \"gold\"<1 AND \"rank\"<5;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"performance_by_nation\" (\n \"rank\" real,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the sum of silver when total is mor ethan 1, bronze is 1 and gold is les than 0"
},
{
"role": "assistant",
"content": "SELECT SUM(\"silver\") FROM \"performance_by_nation\" WHERE \"total\">1 AND \"bronze\"=1 AND \"gold\"<0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"performance_by_nation\" (\n \"rank\" real,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the most gold when bronze is more than 0 and rank is more than 5 with total more than 2"
},
{
"role": "assistant",
"content": "SELECT MAX(\"gold\") FROM \"performance_by_nation\" WHERE \"bronze\">0 AND \"rank\">5 AND \"total\">2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"performance_by_nation\" (\n \"rank\" real,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the average bronze with silver more than 0, total of 6 and gold more than 0"
},
{
"role": "assistant",
"content": "SELECT AVG(\"bronze\") FROM \"performance_by_nation\" WHERE \"silver\">0 AND \"total\"=6 AND \"gold\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"performance_by_nation\" (\n \"rank\" real,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the sum of total with gold more than 1 and bronze more than 0"
},
{
"role": "assistant",
"content": "SELECT SUM(\"total\") FROM \"performance_by_nation\" WHERE \"gold\">1 AND \"bronze\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2005\" (\n \"category\" text,\n \"film\" text,\n \"director_s\" text,\n \"country\" text,\n \"nominating_festival\" text\n);\n\nQuestion: What country did Jonas Geirnaert direct a film in?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"2005\" WHERE \"director_s\"='jonas geirnaert';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2005\" (\n \"category\" text,\n \"film\" text,\n \"director_s\" text,\n \"country\" text,\n \"nominating_festival\" text\n);\n\nQuestion: What Nominating Festival took place in Germany?"
},
{
"role": "assistant",
"content": "SELECT \"nominating_festival\" FROM \"2005\" WHERE \"country\"='germany';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2005\" (\n \"category\" text,\n \"film\" text,\n \"director_s\" text,\n \"country\" text,\n \"nominating_festival\" text\n);\n\nQuestion: What is the category of the film made in Switzerland?"
},
{
"role": "assistant",
"content": "SELECT \"category\" FROM \"2005\" WHERE \"country\"='switzerland';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2005\" (\n \"category\" text,\n \"film\" text,\n \"director_s\" text,\n \"country\" text,\n \"nominating_festival\" text\n);\n\nQuestion: What film was directed by Sandro Aguilar?"
},
{
"role": "assistant",
"content": "SELECT \"film\" FROM \"2005\" WHERE \"director_s\"='sandro aguilar';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"language\" (\n \"language\" text,\n \"number\" text,\n \"percentage_pct\" text,\n \"males\" text,\n \"females\" text\n);\n\nQuestion: Name the language that has number of 14"
},
{
"role": "assistant",
"content": "SELECT \"language\" FROM \"language\" WHERE \"number\"='14';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"language\" (\n \"language\" text,\n \"number\" text,\n \"percentage_pct\" text,\n \"males\" text,\n \"females\" text\n);\n\nQuestion: Name the number which has language of other"
},
{
"role": "assistant",
"content": "SELECT \"number\" FROM \"language\" WHERE \"language\"='other';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: Tell me the average goals for losses of 19 and goals against more than 59"
},
{
"role": "assistant",
"content": "SELECT AVG(\"goals_for\") FROM \"final_table\" WHERE \"losses\"=19 AND \"goals_against\">59;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"final_table\" (\n \"position\" real,\n \"club\" text,\n \"played\" real,\n \"points\" text,\n \"wins\" real,\n \"draws\" real,\n \"losses\" real,\n \"goals_for\" real,\n \"goals_against\" real,\n \"goal_difference\" real\n);\n\nQuestion: Name the average position when the goals against are more than 42 and draws less than 16 with goals of 44"
},
{
"role": "assistant",
"content": "SELECT AVG(\"position\") FROM \"final_table\" WHERE \"goals_against\">42 AND \"goals_for\"=44 AND \"draws\"<16;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" real,\n \"division\" text,\n \"league\" text,\n \"regular_season\" text,\n \"playoffs\" text,\n \"u_s_open_cup\" text,\n \"avg_attendance\" text\n);\n\nQuestion: Which regular season was 2013 in?"
},
{
"role": "assistant",
"content": "SELECT \"regular_season\" FROM \"year_by_year\" WHERE \"year\"=2013;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" real,\n \"division\" text,\n \"league\" text,\n \"regular_season\" text,\n \"playoffs\" text,\n \"u_s_open_cup\" text,\n \"avg_attendance\" text\n);\n\nQuestion: What year did the team make conference semifinals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"year_by_year\" WHERE \"playoffs\"='conference semifinals';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_the_50_largest_country_subdivisi\" (\n \"rank\" real,\n \"subdivision_name\" text,\n \"country\" text,\n \"area_km\" real,\n \"population\" real\n);\n\nQuestion: What's the name of a subdivision in Denmark ranked less than 24 with an area greater than 1,420,968?"
},
{
"role": "assistant",
"content": "SELECT \"subdivision_name\" FROM \"list_of_the_50_largest_country_subdivisi\" WHERE \"rank\"<24 AND \"area_km\">'1,420,968' AND \"country\"='denmark';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_the_50_largest_country_subdivisi\" (\n \"rank\" real,\n \"subdivision_name\" text,\n \"country\" text,\n \"area_km\" real,\n \"population\" real\n);\n\nQuestion: What's the smallest area in Russia that is ranked 23 with a population more than 522,800?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"area_km\") FROM \"list_of_the_50_largest_country_subdivisi\" WHERE \"country\"='russia' AND \"rank\"=23 AND \"population\">'522,800';"
}
]
|
[
{
"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: On the date of June 8 what was the record?"
},
{
"role": "assistant",
"content": "SELECT \"record\" FROM \"game_log\" WHERE \"date\"='june 8';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: On the date of June 15 what was the score?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"game_log\" WHERE \"date\"='june 15';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_seven\" (\n \"pick_num\" text,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"nhl_team\" text,\n \"college_junior_club_team\" text\n);\n\nQuestion: What College/junior/club had a player of United States nationality drafted by the Toronto Maple Leafs?"
},
{
"role": "assistant",
"content": "SELECT \"college_junior_club_team\" FROM \"round_seven\" WHERE \"nhl_team\"='toronto maple leafs' AND \"nationality\"='united states';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"round_seven\" (\n \"pick_num\" text,\n \"player\" text,\n \"position\" text,\n \"nationality\" text,\n \"nhl_team\" text,\n \"college_junior_club_team\" text\n);\n\nQuestion: What is the college/junior/club team of the defence player drafted by the New York Rangers?"
},
{
"role": "assistant",
"content": "SELECT \"college_junior_club_team\" FROM \"round_seven\" WHERE \"nhl_team\"='new york rangers' AND \"position\"='defence';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: What is the rank of the cadillac northstar lmp02 chassis?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"complete_american_le_mans_series_results\" WHERE \"chassis\"='cadillac northstar lmp02';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: What is the entrant for the audi 3.6l turbo v8 engine and ranked 3rd with 163 points?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_american_le_mans_series_results\" WHERE \"engine\"='audi 3.6l turbo v8' AND \"rank\"='3rd' AND \"points\"=163;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: What is the rank with more than 123 points, an audi r8 chassis, and a lmp900 class?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"complete_american_le_mans_series_results\" WHERE \"points\">123 AND \"chassis\"='audi r8' AND \"class\"='lmp900';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: What is the engine for the bmw motorsport entrant with 123 points before 2004?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"complete_american_le_mans_series_results\" WHERE \"year\"<2004 AND \"entrant\"='bmw motorsport' AND \"points\"=123;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which points have a Combined elapsed time of 175d 20h 46m 04s?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"bt_global_challenge_2000_1\" WHERE \"combined_elapsed_time\"='175d 20h 46m 04s';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which yacht name has a Combined elapsed time of 179d 11h 58m 14s?"
},
{
"role": "assistant",
"content": "SELECT \"yacht_name\" FROM \"bt_global_challenge_2000_1\" WHERE \"combined_elapsed_time\"='179d 11h 58m 14s';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which skipper has 78 points?"
},
{
"role": "assistant",
"content": "SELECT \"skipper\" FROM \"bt_global_challenge_2000_1\" WHERE \"points\"='78';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which points have an Overall place of 9=, and a Skipper of nick fenton?"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"bt_global_challenge_2000_1\" WHERE \"overall_place\"='9=' AND \"skipper\"='nick fenton';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which Overall place has a Yacht name of lg flatron?"
},
{
"role": "assistant",
"content": "SELECT \"overall_place\" FROM \"bt_global_challenge_2000_1\" WHERE \"yacht_name\"='lg flatron';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"bt_global_challenge_2000_1\" (\n \"overall_place\" text,\n \"yacht_name\" text,\n \"skipper\" text,\n \"points\" text,\n \"combined_elapsed_time\" text\n);\n\nQuestion: Which Combined elapsed time has a Skipper of stephen wilkins?"
},
{
"role": "assistant",
"content": "SELECT \"combined_elapsed_time\" FROM \"bt_global_challenge_2000_1\" WHERE \"skipper\"='stephen wilkins';"
}
]
|
[
{
"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: Before the year 1988, what is the lowest number of points that entrant Coloni SpA scored?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"points\") FROM \"complete_formula_one_results\" WHERE \"entrant\"='coloni spa' AND \"year\"<1988;"
}
]
|
[
{
"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 chassis used by the entrant Automobiles Gonfaronnaises Sportives scored 0 points?"
},
{
"role": "assistant",
"content": "SELECT \"chassis\" FROM \"complete_formula_one_results\" WHERE \"points\"=0 AND \"entrant\"='automobiles gonfaronnaises sportives';"
}
]
|
[
{
"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: Who was the entrant before 1988?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_formula_one_results\" WHERE \"year\"<1988;"
}
]
|
[
{
"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 engine was used in 1987?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"complete_formula_one_results\" WHERE \"year\"=1987;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" real,\n \"division\" text,\n \"league\" text,\n \"reg_season\" text,\n \"playoffs\" text,\n \"open_cup\" text\n);\n\nQuestion: What league did they play in 2001?"
},
{
"role": "assistant",
"content": "SELECT \"league\" FROM \"year_by_year\" WHERE \"year\"=2001;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" real,\n \"division\" text,\n \"league\" text,\n \"reg_season\" text,\n \"playoffs\" text,\n \"open_cup\" text\n);\n\nQuestion: What open cup did they play in when they finished 2nd, northeast in the reg. season?"
},
{
"role": "assistant",
"content": "SELECT \"open_cup\" FROM \"year_by_year\" WHERE \"reg_season\"='2nd, northeast';"
}
]
|
[
{
"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: What is the week with a date of October 9, 1983, and attendance smaller than 40,492?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"week\") FROM \"schedule\" WHERE \"date\"='october 9, 1983' AND \"attendance\"<'40,492';"
}
]
|
[
{
"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: What is the lowest attendance with week 14?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"schedule\" WHERE \"week\"=14;"
}
]
|
[
{
"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 \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: Where did the Oakland Raiders play in week 12 of their 1976 season?"
},
{
"role": "assistant",
"content": "SELECT \"game_site\" FROM \"schedule\" WHERE \"week\"=12;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"entrant\"='barclay nordica arrows bmw' AND \"engine\"='cosworth v8';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: How many years did barclay nordica arrows bmw enter with a bmw str-4 t/c engine with less than 1 point?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"engine\"='bmw str-4 t/c' AND \"entrant\"='barclay nordica arrows bmw' AND \"points\"<1;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: How many years was ensign n180b a Chassis with 4 points?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"points\"=4 AND \"chassis\"='ensign n180b';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2011_regular_season_football_standings\" (\n \"school\" text,\n \"team\" text,\n \"division_record\" text,\n \"overall_record\" text,\n \"season_outcome\" text\n);\n\nQuestion: What is the division record for the Indians?"
},
{
"role": "assistant",
"content": "SELECT \"division_record\" FROM \"2011_regular_season_football_standings\" WHERE \"team\"='indians';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2011_regular_season_football_standings\" (\n \"school\" text,\n \"team\" text,\n \"division_record\" text,\n \"overall_record\" text,\n \"season_outcome\" text\n);\n\nQuestion: What is the overall record of Indian River?"
},
{
"role": "assistant",
"content": "SELECT \"overall_record\" FROM \"2011_regular_season_football_standings\" WHERE \"school\"='indian river';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2011_regular_season_football_standings\" (\n \"school\" text,\n \"team\" text,\n \"division_record\" text,\n \"overall_record\" text,\n \"season_outcome\" text\n);\n\nQuestion: What was the season outcome of Lake Forest?"
},
{
"role": "assistant",
"content": "SELECT \"season_outcome\" FROM \"2011_regular_season_football_standings\" WHERE \"school\"='lake forest';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"kawerau_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real\n);\n\nQuestion: How many Deciles are coed?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"decile\") FROM \"kawerau_district\" WHERE \"gender\"='coed';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"kawerau_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real\n);\n\nQuestion: Which is the lowest Decile that is coed?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"decile\") FROM \"kawerau_district\" WHERE \"gender\"='coed';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"kawerau_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real\n);\n\nQuestion: What are the years for Kawerau Putauaki School?"
},
{
"role": "assistant",
"content": "SELECT \"years\" FROM \"kawerau_district\" WHERE \"name\"='kawerau putauaki school';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"calendar\" (\n \"round_race\" text,\n \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"winning_team\" text\n);\n\nQuestion: What is the round or race of the winning driver Charles Hollings and what was his pole position?"
},
{
"role": "assistant",
"content": "SELECT \"round_race\" FROM \"calendar\" WHERE \"winning_driver\"='charles hollings' AND \"pole_position\"='charles hollings';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"performance\" text\n);\n\nQuestion: What was the earliest year in which long jump was performed in the world indoor Championships in 5th position?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"achievements\" WHERE \"performance\"='long jump' AND \"competition\"='world indoor championships' AND \"position\"='5th';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"performance\" text\n);\n\nQuestion: What was the latest year in which she took 4th position in Budapest, Hungary?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"year\") FROM \"achievements\" WHERE \"position\"='4th' AND \"venue\"='budapest, hungary';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"apollo_astronauts_who_walked_on_the_moon\" (\n \"name\" text,\n \"born\" text,\n \"age_at_first_step\" text,\n \"mission\" text,\n \"lunar_eva_dates\" text,\n \"service\" text\n);\n\nQuestion: Which astronaut went on the Apollo 16 mission at the age of 36y 6m 18d to step on the moon?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"apollo_astronauts_who_walked_on_the_moon\" WHERE \"mission\"='apollo 16' AND \"age_at_first_step\"='36y 6m 18d';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"apollo_astronauts_who_walked_on_the_moon\" (\n \"name\" text,\n \"born\" text,\n \"age_at_first_step\" text,\n \"mission\" text,\n \"lunar_eva_dates\" text,\n \"service\" text\n);\n\nQuestion: David Scott went on which mission?"
},
{
"role": "assistant",
"content": "SELECT \"mission\" FROM \"apollo_astronauts_who_walked_on_the_moon\" WHERE \"name\"='david scott';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"apollo_astronauts_who_walked_on_the_moon\" (\n \"name\" text,\n \"born\" text,\n \"age_at_first_step\" text,\n \"mission\" text,\n \"lunar_eva_dates\" text,\n \"service\" text\n);\n\nQuestion: The astronaut who was 37y 8m 4d when making a first step on the moon was in which service?"
},
{
"role": "assistant",
"content": "SELECT \"service\" FROM \"apollo_astronauts_who_walked_on_the_moon\" WHERE \"age_at_first_step\"='37y 8m 4d';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"apollo_astronauts_who_walked_on_the_moon\" (\n \"name\" text,\n \"born\" text,\n \"age_at_first_step\" text,\n \"mission\" text,\n \"lunar_eva_dates\" text,\n \"service\" text\n);\n\nQuestion: Pete Conrad was on the Apollo 12 mission but also had what Lunar EVA dates?"
},
{
"role": "assistant",
"content": "SELECT \"lunar_eva_dates\" FROM \"apollo_astronauts_who_walked_on_the_moon\" WHERE \"mission\"='apollo 12' AND \"name\"='pete conrad';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"apollo_astronauts_who_walked_on_the_moon\" (\n \"name\" text,\n \"born\" text,\n \"age_at_first_step\" text,\n \"mission\" text,\n \"lunar_eva_dates\" text,\n \"service\" text\n);\n\nQuestion: The Apollo astronaut who was 38y 9m 7d when first stepping on the moon is who?"
},
{
"role": "assistant",
"content": "SELECT \"born\" FROM \"apollo_astronauts_who_walked_on_the_moon\" WHERE \"age_at_first_step\"='38y 9m 7d';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"rank\" text,\n \"points\" text\n);\n\nQuestion: Which class has a year prior to 2011 and audi r15 tdi as the chassis?"
},
{
"role": "assistant",
"content": "SELECT \"class\" FROM \"complete_american_le_mans_series_results\" WHERE \"year\"<2011 AND \"chassis\"='audi r15 tdi';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"rank\" text,\n \"points\" text\n);\n\nQuestion: Which engine has a year later than 2006 and 60 as the points?"
},
{
"role": "assistant",
"content": "SELECT \"engine\" FROM \"complete_american_le_mans_series_results\" WHERE \"year\">2006 AND \"points\"='60';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"rank\" text,\n \"points\" text\n);\n\nQuestion: How many years has an engine of audi 3.6l turbo v8 and 1st as the rank with an audi r8r as the chassis?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"complete_american_le_mans_series_results\" WHERE \"engine\"='audi 3.6l turbo v8' AND \"rank\"='1st' AND \"chassis\"='audi r8r';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_american_le_mans_series_results\" (\n \"year\" real,\n \"entrant\" text,\n \"class\" text,\n \"chassis\" text,\n \"engine\" text,\n \"rank\" text,\n \"points\" text\n);\n\nQuestion: Which entrant has 25th as the rank?"
},
{
"role": "assistant",
"content": "SELECT \"entrant\" FROM \"complete_american_le_mans_series_results\" WHERE \"rank\"='25th';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the average year Rich Beem had a to par less than 17?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"year_won\") FROM \"missed_the_cut\" WHERE \"player\"='rich beem' AND \"to_par\"<17;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the earliest year won with a total bigger than 156?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year_won\") FROM \"missed_the_cut\" WHERE \"total\">156;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the total for Bob Tway for the year won before 2002 with a to par bigger than 7?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total\") FROM \"missed_the_cut\" WHERE \"year_won\"<2002 AND \"player\"='bob tway' AND \"to_par\">7;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the to par for Paul Azinger from the United States after 1986 for a total bigger than 145?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"to_par\") FROM \"missed_the_cut\" WHERE \"country\"='united states' AND \"year_won\">1986 AND \"player\"='paul azinger' AND \"total\">145;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the earliest year won Paul Azinger had with a to par higher than 5?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year_won\") FROM \"missed_the_cut\" WHERE \"player\"='paul azinger' AND \"to_par\">5;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"missed_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_won\" real,\n \"total\" real,\n \"to_par\" real\n);\n\nQuestion: What is the year won by Australia with a to par bigger than 16?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year_won\") FROM \"missed_the_cut\" WHERE \"country\"='australia' AND \"to_par\">16;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"representative\" text,\n \"years\" text,\n \"state\" text,\n \"party\" text,\n \"lifespan\" text\n);\n\nQuestion: What is the Lifespan when the Representative is Theodore F. Kluttz?"
},
{
"role": "assistant",
"content": "SELECT \"lifespan\" FROM \"references\" WHERE \"representative\"='theodore f. kluttz';"
}
]
|
[
{
"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 \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: What week's game had a result of l 35\u201337?"
},
{
"role": "assistant",
"content": "SELECT \"week\" FROM \"schedule\" WHERE \"result\"='l 35\u201337';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What year was trio brdeact wind allass the entrant?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"complete_formula_one_world_championship_\" WHERE \"entrant\"='trio brdeact wind allass';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What is the year when kurtis kraft 500f was the chassis?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"chassis\"='kurtis kraft 500f';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What is the earliest year when the points were more than 0?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"points\">0;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"clutha_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: What's the school name in Balclutha that has a Decile of 7 and a roll larger than 186?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"clutha_district\" WHERE \"area\"='balclutha' AND \"decile\"<7 AND \"roll\">186;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"clutha_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: Which school in Balclutha has a roll smaller than 55?"
},
{
"role": "assistant",
"content": "SELECT \"name\" FROM \"clutha_district\" WHERE \"area\"='balclutha' AND \"roll\"<55;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"edmonton_oilers_4_winnipeg_jets_1\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: When has winnipeg jets with a Score of 4\u20136?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"edmonton_oilers_4_winnipeg_jets_1\" WHERE \"home\"='winnipeg jets' AND \"score\"='4\u20136';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"edmonton_oilers_4_winnipeg_jets_1\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: When is Edmonton Oilers in?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"edmonton_oilers_4_winnipeg_jets_1\" WHERE \"home\"='edmonton oilers';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"edmonton_oilers_4_winnipeg_jets_1\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Score that has a Winnipeg Jets as Visitor on april 7?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"edmonton_oilers_4_winnipeg_jets_1\" WHERE \"visitor\"='winnipeg jets' AND \"date\"='april 7';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"edmonton_oilers_4_winnipeg_jets_1\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: What is the Score on April 6?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"edmonton_oilers_4_winnipeg_jets_1\" WHERE \"date\"='april 6';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"edmonton_oilers_4_winnipeg_jets_1\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"record\" text\n);\n\nQuestion: When has a Record of 1\u20130?"
},
{
"role": "assistant",
"content": "SELECT \"date\" FROM \"edmonton_oilers_4_winnipeg_jets_1\" WHERE \"record\"='1\u20130';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"llws_results\" (\n \"year\" real,\n \"champion\" text,\n \"city\" text,\n \"llws\" text,\n \"record\" text\n);\n\nQuestion: What is the LLWS when the Year is 2003?"
},
{
"role": "assistant",
"content": "SELECT \"llws\" FROM \"llws_results\" WHERE \"year\"=2003;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"llws_results\" (\n \"year\" real,\n \"champion\" text,\n \"city\" text,\n \"llws\" text,\n \"record\" text\n);\n\nQuestion: What is the earliest Year when the City is Peabody?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"llws_results\" WHERE \"city\"='peabody';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"llws_results\" (\n \"year\" real,\n \"champion\" text,\n \"city\" text,\n \"llws\" text,\n \"record\" text\n);\n\nQuestion: What is the total number of Years when the LLWS is 4th place, and when the City is Westport?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"year\") FROM \"llws_results\" WHERE \"llws\"='4th place' AND \"city\"='westport';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: What team has Pony as the kit manufacturer and Gary Mabbutt as the captain?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"personnel_and_kits\" WHERE \"kit_manufacturer\"='pony' AND \"captain\"='gary mabbutt';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: Who is the manager 1 for Leeds United?"
},
{
"role": "assistant",
"content": "SELECT \"manager_1\" FROM \"personnel_and_kits\" WHERE \"team\"='leeds united';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: What is the team with a Pony kit manufacturer and Julian Dicks as the captain?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"personnel_and_kits\" WHERE \"kit_manufacturer\"='pony' AND \"captain\"='julian dicks';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: What team has a kit manufacturer of Umbro and Eric Cantona as captain?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"personnel_and_kits\" WHERE \"kit_manufacturer\"='umbro' AND \"captain\"='eric cantona';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: Who is the manager 1 with Puma as the kit manufacturer and Puma as the shirt sponsor?"
},
{
"role": "assistant",
"content": "SELECT \"manager_1\" FROM \"personnel_and_kits\" WHERE \"kit_manufacturer\"='puma' AND \"shirt_sponsor\"='puma';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"personnel_and_kits\" (\n \"team\" text,\n \"manager_1\" text,\n \"captain\" text,\n \"kit_manufacturer\" text,\n \"shirt_sponsor\" text\n);\n\nQuestion: What is the kit manufacturer with Walkers as the shirt sponsor?"
},
{
"role": "assistant",
"content": "SELECT \"kit_manufacturer\" FROM \"personnel_and_kits\" WHERE \"shirt_sponsor\"='walkers';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_international_formula_3000_resu\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"points\" real\n);\n\nQuestion: Name the average points for dallara 3087 lola t88/50 and year before 1988"
},
{
"role": "assistant",
"content": "SELECT AVG(\"points\") FROM \"complete_international_formula_3000_resu\" WHERE \"chassis\"='dallara 3087 lola t88/50' AND \"year\"<1988;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_international_formula_3000_resu\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"points\" real\n);\n\nQuestion: Name the sum of points for 1992"
},
{
"role": "assistant",
"content": "SELECT SUM(\"points\") FROM \"complete_international_formula_3000_resu\" WHERE \"year\"=1992;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_international_formula_3000_resu\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"points\" real\n);\n\nQuestion: Name the points for year more than 1987"
},
{
"role": "assistant",
"content": "SELECT \"points\" FROM \"complete_international_formula_3000_resu\" WHERE \"year\">1987;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"complete_international_formula_3000_resu\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"tyres\" text,\n \"points\" real\n);\n\nQuestion: Name the year for points less than 20 and chassis of dallara 3087"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"complete_international_formula_3000_resu\" WHERE \"points\"<20 AND \"chassis\"='dallara 3087';"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international\" (\n \"national_team\" text,\n \"club\" text,\n \"season\" text,\n \"apps\" real,\n \"goals\" real\n);\n\nQuestion: What is the most apps that a has a total season and 3 goals?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"apps\") FROM \"international\" WHERE \"season\"='total' AND \"goals\">3;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"international\" (\n \"national_team\" text,\n \"club\" text,\n \"season\" text,\n \"apps\" real,\n \"goals\" real\n);\n\nQuestion: What is the final number of apps with 2 goals?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"apps\") FROM \"international\" WHERE \"goals\"=2;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"series_4\" (\n \"episode_no\" real,\n \"airdate\" text,\n \"total_viewers\" real,\n \"share\" text,\n \"bbc_one_weekly_ranking\" real\n);\n\nQuestion: What date did the episode with a weekly ranking of 14 air?"
},
{
"role": "assistant",
"content": "SELECT \"airdate\" FROM \"series_4\" WHERE \"bbc_one_weekly_ranking\"=14;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"series_4\" (\n \"episode_no\" real,\n \"airdate\" text,\n \"total_viewers\" real,\n \"share\" text,\n \"bbc_one_weekly_ranking\" real\n);\n\nQuestion: What is the total number of total viewers with a share of 18.8% and a weekly ranking under 16?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"total_viewers\") FROM \"series_4\" WHERE \"share\"='18.8%' AND \"bbc_one_weekly_ranking\"<16;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Who has 37 grids?"
},
{
"role": "assistant",
"content": "SELECT \"rider\" FROM \"125cc_classification\" WHERE \"grid\"=37;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the average grid with more than 23 laps?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"grid\") FROM \"125cc_classification\" WHERE \"laps\">23;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"125cc_classification\" (\n \"rider\" text,\n \"manufacturer\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the average grid with more than 23 laps?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"grid\") FROM \"125cc_classification\" WHERE \"laps\">23;"
}
]
|
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"thames_coromandel_district\" (\n \"name\" text,\n \"years\" text,\n \"gender\" text,\n \"area\" text,\n \"authority\" text,\n \"decile\" real,\n \"roll\" real\n);\n\nQuestion: What is the average decile for te puru school?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"decile\") FROM \"thames_coromandel_district\" WHERE \"name\"='te puru school';"
}
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.