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 \"projects_as_of_march_2013\" (\n \"building\" text,\n \"location\" text,\n \"height\" text,\n \"floors\" real,\n \"status\" text\n);\n\nQuestion: How many floors are in little Italy?" }, { "role": "assistant", "content": "SELECT COUNT(\"floors\") FROM \"projects_as_of_march_2013\" WHERE \"location\"='little italy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"qualifying_races\" (\n \"place\" text,\n \"country\" text,\n \"qualifying_grand_prix\" text,\n \"class\" text,\n \"dates\" text\n);\n\nQuestion: What is Country, when Class is \"15 meters\", and when Qualifying Grand Prix is \"Soaring Grand Prix Of United Kingdom\"?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"qualifying_races\" WHERE \"class\"='15 meters' AND \"qualifying_grand_prix\"='soaring grand prix of united kingdom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"qualifying_races\" (\n \"place\" text,\n \"country\" text,\n \"qualifying_grand_prix\" text,\n \"class\" text,\n \"dates\" text\n);\n\nQuestion: What is Class, when Dates is \"22 April - 3 May 2009\"?" }, { "role": "assistant", "content": "SELECT \"class\" FROM \"qualifying_races\" WHERE \"dates\"='22 april - 3 may 2009';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"qualifying_races\" (\n \"place\" text,\n \"country\" text,\n \"qualifying_grand_prix\" text,\n \"class\" text,\n \"dates\" text\n);\n\nQuestion: What is Country, when Class is \"club\"?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"qualifying_races\" WHERE \"class\"='club';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"qualifying_races\" (\n \"place\" text,\n \"country\" text,\n \"qualifying_grand_prix\" text,\n \"class\" text,\n \"dates\" text\n);\n\nQuestion: What is Country, when Place is \"Torino\"?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"qualifying_races\" WHERE \"place\"='torino';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"appearances_and_goals\" (\n \"squad_no\" real,\n \"name\" text,\n \"position\" text,\n \"league_apps\" text,\n \"league_goals\" real,\n \"fa_cup_apps\" text,\n \"fa_cup_goals\" real,\n \"league_cup_apps\" text,\n \"league_cup_goals\" real,\n \"flt_apps\" text,\n \"flt_goals\" real,\n \"total_apps\" text,\n \"total_goals\" real\n);\n\nQuestion: WHAT IS THE AVERAGE SQUAD NUMBER WITH MARTIN SMITH, AND LEAGUE GOALS LESS THAN 17?" }, { "role": "assistant", "content": "SELECT AVG(\"squad_no\") FROM \"appearances_and_goals\" WHERE \"name\"='martin smith' AND \"league_goals\"<17;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is No. 5, when No. 9 is Michael, and when Region (Year) is New Hampshire (2010)?" }, { "role": "assistant", "content": "SELECT \"no_5\" FROM \"male_names\" WHERE \"no_9\"='michael' AND \"region_year\"='new hampshire (2010)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is Region (Year), when No. 7 is William, and when No. 2 is Alexander?" }, { "role": "assistant", "content": "SELECT \"region_year\" FROM \"male_names\" WHERE \"no_7\"='william' AND \"no_2\"='alexander';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is No. 10, when No. 1 is Noah, and when No. 9 is Carter?" }, { "role": "assistant", "content": "SELECT \"no_10\" FROM \"male_names\" WHERE \"no_1\"='noah' AND \"no_9\"='carter';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is No. 7, when Region (Year) is Arizona (2010)?" }, { "role": "assistant", "content": "SELECT \"no_7\" FROM \"male_names\" WHERE \"region_year\"='arizona (2010)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is No. 1, when Region (Year) is Mississippi (2010)?" }, { "role": "assistant", "content": "SELECT \"no_1\" FROM \"male_names\" WHERE \"region_year\"='mississippi (2010)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is No. 8, when No. 10 is Hunter?" }, { "role": "assistant", "content": "SELECT \"no_8\" FROM \"male_names\" WHERE \"no_10\"='hunter';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"final_leaderboard\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text,\n \"money\" real\n);\n\nQuestion: How much did Larry Nelson win?" }, { "role": "assistant", "content": "SELECT \"money\" FROM \"final_leaderboard\" WHERE \"player\"='larry nelson';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lpga_tour_wins_27\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Tournament, when Date is \"Sep 12, 1976\"?" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"lpga_tour_wins_27\" WHERE \"date\"='sep 12, 1976';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lpga_tour_wins_27\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Tournament, when Date is \"Sep 25, 1977\"?" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"lpga_tour_wins_27\" WHERE \"date\"='sep 25, 1977';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lpga_tour_wins_27\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_s_up\" text\n);\n\nQuestion: What is Margin of Victory, when Tournament is \"Women's Kemper Open\"?" }, { "role": "assistant", "content": "SELECT \"margin_of_victory\" FROM \"lpga_tour_wins_27\" WHERE \"tournament\"='women''s kemper open';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No. 8 of the person with a No. 4 of Noah?" }, { "role": "assistant", "content": "SELECT \"no_8\" FROM \"male_names\" WHERE \"no_4\"='noah';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No. 8 of the person with a No. 4 of Matthew and a No. 7 of Anthony?" }, { "role": "assistant", "content": "SELECT \"no_8\" FROM \"male_names\" WHERE \"no_4\"='matthew' AND \"no_7\"='anthony';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No. 1 of the person with a No. 2 of John?" }, { "role": "assistant", "content": "SELECT \"no_1\" FROM \"male_names\" WHERE \"no_2\"='john';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No. 6 of the person with a No. 10 of Joshua and a No. 8 of Andrew?" }, { "role": "assistant", "content": "SELECT \"no_6\" FROM \"male_names\" WHERE \"no_10\"='joshua' AND \"no_8\"='andrew';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No. 2 of the person with a No. 5 of Ethan and NO. 7 of Jackson?" }, { "role": "assistant", "content": "SELECT \"no_2\" FROM \"male_names\" WHERE \"no_4\"='ethan' AND \"no_7\"='jackson';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"male_names\" (\n \"region_year\" text,\n \"no_1\" text,\n \"no_2\" text,\n \"no_3\" text,\n \"no_4\" text,\n \"no_5\" text,\n \"no_6\" text,\n \"no_7\" text,\n \"no_8\" text,\n \"no_9\" text,\n \"no_10\" text\n);\n\nQuestion: What is the No 1 from the Maryland (2008) Region (year)?" }, { "role": "assistant", "content": "SELECT \"no_1\" FROM \"male_names\" WHERE \"region_year\"='maryland (2008)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"national_final\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"points\" real,\n \"place\" text\n);\n\nQuestion: What was the draw of Maggie Toal?" }, { "role": "assistant", "content": "SELECT AVG(\"draw\") FROM \"national_final\" WHERE \"artist\"='maggie toal';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"national_final\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"points\" real,\n \"place\" text\n);\n\nQuestion: What is the highest point total that placed 3rd and has a draw larger than 5?" }, { "role": "assistant", "content": "SELECT MAX(\"points\") FROM \"national_final\" WHERE \"place\"='3rd' AND \"draw\">5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"host_city_cities\" text,\n \"host_country_countries\" text\n);\n\nQuestion: Who won the gold in 1958?" }, { "role": "assistant", "content": "SELECT \"gold\" FROM \"champions\" WHERE \"year\"='1958';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"host_city_cities\" text,\n \"host_country_countries\" text\n);\n\nQuestion: What was the host country when the silver was [[|]] (2) and bronze is czechoslovakia (3)?" }, { "role": "assistant", "content": "SELECT \"host_country_countries\" FROM \"champions\" WHERE \"silver\"='[[|]] (2)' AND \"bronze\"='czechoslovakia (3)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"host_city_cities\" text,\n \"host_country_countries\" text\n);\n\nQuestion: Who was the host country in 2007?" }, { "role": "assistant", "content": "SELECT \"host_country_countries\" FROM \"champions\" WHERE \"year\"='2007';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"champions\" (\n \"year\" text,\n \"gold\" text,\n \"silver\" text,\n \"bronze\" text,\n \"host_city_cities\" text,\n \"host_country_countries\" text\n);\n\nQuestion: Who was the host country when bronze is [[|]] (1) and host city is Krynica?" }, { "role": "assistant", "content": "SELECT \"host_country_countries\" FROM \"champions\" WHERE \"bronze\"='[[|]] (1)' AND \"host_city_cities\"='krynica';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: What is the result for Boston's road team in game 4?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"nba_finals\" WHERE \"road_team\"='boston' AND \"game\"='game 4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: Which road team has a result of 117-114?" }, { "role": "assistant", "content": "SELECT \"road_team\" FROM \"nba_finals\" WHERE \"result\"='117-114';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: What is the road team playing against Boston on April 16?" }, { "role": "assistant", "content": "SELECT \"road_team\" FROM \"nba_finals\" WHERE \"home_team\"='boston' AND \"date\"='april 16';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: Which home team is on April 21?" }, { "role": "assistant", "content": "SELECT \"home_team\" FROM \"nba_finals\" WHERE \"date\"='april 21';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: Which game has a result of 113-106?" }, { "role": "assistant", "content": "SELECT \"game\" FROM \"nba_finals\" WHERE \"result\"='113-106';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nba_finals\" (\n \"game\" text,\n \"date\" text,\n \"home_team\" text,\n \"result\" text,\n \"road_team\" text\n);\n\nQuestion: Which home team played against Los Angeles in game 1?" }, { "role": "assistant", "content": "SELECT \"home_team\" FROM \"nba_finals\" WHERE \"road_team\"='los angeles' AND \"game\"='game 1';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"chessmetrics\" (\n \"rank\" real,\n \"1_year_peak\" text,\n \"5_year_peak\" text,\n \"10_year_peak\" text,\n \"15_year_peak\" text,\n \"20_year_peak\" text\n);\n\nQuestion: What is the lowest rank of 5-year peak bobby fischer, 2841?" }, { "role": "assistant", "content": "SELECT MIN(\"rank\") FROM \"chessmetrics\" WHERE \"5_year_peak\"='bobby fischer, 2841';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"chessmetrics\" (\n \"rank\" real,\n \"1_year_peak\" text,\n \"5_year_peak\" text,\n \"10_year_peak\" text,\n \"15_year_peak\" text,\n \"20_year_peak\" text\n);\n\nQuestion: What is the 1-year peak with anatoly karpov, 2821 as the 10-year peak?" }, { "role": "assistant", "content": "SELECT \"1_year_peak\" FROM \"chessmetrics\" WHERE \"10_year_peak\"='anatoly karpov, 2821';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"chessmetrics\" (\n \"rank\" real,\n \"1_year_peak\" text,\n \"5_year_peak\" text,\n \"10_year_peak\" text,\n \"15_year_peak\" text,\n \"20_year_peak\" text\n);\n\nQuestion: What is the 20-year peak with emanuel lasker, 2816 as the 15-year peak?" }, { "role": "assistant", "content": "SELECT \"20_year_peak\" FROM \"chessmetrics\" WHERE \"15_year_peak\"='emanuel lasker, 2816';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_county\" (\n \"county\" text,\n \"kerrypct\" text,\n \"kerrynum\" real,\n \"bushpct\" text,\n \"bushnum\" real,\n \"otherspct\" text,\n \"othersnum\" real,\n \"2000_result\" text\n);\n\nQuestion: What percentage of other candidates did the county which voted 52.1% for Kerry vote for?" }, { "role": "assistant", "content": "SELECT MAX(\"othersnum\") FROM \"by_county\" WHERE \"kerrypct\"='52.1%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_county\" (\n \"county\" text,\n \"kerrypct\" text,\n \"kerrynum\" real,\n \"bushpct\" text,\n \"bushnum\" real,\n \"otherspct\" text,\n \"othersnum\" real,\n \"2000_result\" text\n);\n\nQuestion: How many votes did Kerry get in the county that gave Bush 189,605 votes?" }, { "role": "assistant", "content": "SELECT AVG(\"kerrynum\") FROM \"by_county\" WHERE \"bushnum\"='189,605';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_county\" (\n \"county\" text,\n \"kerrypct\" text,\n \"kerrynum\" real,\n \"bushpct\" text,\n \"bushnum\" real,\n \"otherspct\" text,\n \"othersnum\" real,\n \"2000_result\" text\n);\n\nQuestion: How many votes went to other candidates in the county that gave 1.9% votes to them, and 160,390 total votes to Bush?" }, { "role": "assistant", "content": "SELECT MIN(\"othersnum\") FROM \"by_county\" WHERE \"otherspct\"='1.9%' AND \"bushnum\"<'160,390';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"seat_allocation\" (\n \"governorate\" text,\n \"seats_2010\" real,\n \"seats_2005\" real,\n \"in_de_creased_by\" real,\n \"percentage_in_de_crease\" text\n);\n\nQuestion: How many Seats 2005 has a Percentage in/de-crease of 50.0%, and a Governorate of dhi qar governorate, and a In/de-creased by larger than 6?" }, { "role": "assistant", "content": "SELECT SUM(\"seats_2005\") FROM \"seat_allocation\" WHERE \"percentage_in_de_crease\"='50.0%' AND \"governorate\"='dhi qar governorate' AND \"in_de_creased_by\">6;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"seat_allocation\" (\n \"governorate\" text,\n \"seats_2010\" real,\n \"seats_2005\" real,\n \"in_de_creased_by\" real,\n \"percentage_in_de_crease\" text\n);\n\nQuestion: Name the lowest Seats 2010 which has Seats 2005 smaller than 9, and a Governorate of al muthanna governorate, and an In/de-creased by larger than 2?" }, { "role": "assistant", "content": "SELECT MIN(\"seats_2010\") FROM \"seat_allocation\" WHERE \"seats_2005\"<9 AND \"governorate\"='al muthanna governorate' AND \"in_de_creased_by\">2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"seat_allocation\" (\n \"governorate\" text,\n \"seats_2010\" real,\n \"seats_2005\" real,\n \"in_de_creased_by\" real,\n \"percentage_in_de_crease\" text\n);\n\nQuestion: Name the average In/de-creased by which has a Governorate of al anbar governorate, and Seats 2005 smaller than 9?" }, { "role": "assistant", "content": "SELECT AVG(\"in_de_creased_by\") FROM \"seat_allocation\" WHERE \"governorate\"='al anbar governorate' AND \"seats_2005\"<9;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"seat_allocation\" (\n \"governorate\" text,\n \"seats_2010\" real,\n \"seats_2005\" real,\n \"in_de_creased_by\" real,\n \"percentage_in_de_crease\" text\n);\n\nQuestion: Name the highest In/de-creased which has a Percentage in/de-crease of 100%, and Seats 2010 larger than 8?" }, { "role": "assistant", "content": "SELECT MAX(\"in_de_creased_by\") FROM \"seat_allocation\" WHERE \"percentage_in_de_crease\"='100%' AND \"seats_2010\">8;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"first_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" real,\n \"to_par\" text\n);\n\nQuestion: What player has a score larger than 67?" }, { "role": "assistant", "content": "SELECT \"player\" FROM \"first_round\" WHERE \"score\">67;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"location\" text,\n \"record\" text\n);\n\nQuestion: What is the celtics record after game 33 when they score of the game was 111-108?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"game_log\" WHERE \"game\">33 AND \"score\"='111-108';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"supersport_race_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: Which Rider is grid 7?" }, { "role": "assistant", "content": "SELECT \"rider\" FROM \"supersport_race_classification\" WHERE \"grid\"=7;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"supersport_race_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the total number of laps done by Massimo Roccoli when his grid was smaller than 4?" }, { "role": "assistant", "content": "SELECT COUNT(\"laps\") FROM \"supersport_race_classification\" WHERE \"rider\"='massimo roccoli' AND \"grid\"<4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"supersport_race_classification\" (\n \"rider\" text,\n \"bike\" text,\n \"laps\" real,\n \"time\" text,\n \"grid\" real\n);\n\nQuestion: What is the time recorded by David Salom on his Yamaha yzf-r6 when his grid was larger than 1?" }, { "role": "assistant", "content": "SELECT \"time\" FROM \"supersport_race_classification\" WHERE \"bike\"='yamaha yzf-r6' AND \"grid\">1 AND \"rider\"='david salom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"platforms\" (\n \"stop_no\" text,\n \"platform\" text,\n \"line\" text,\n \"stopping_pattern\" text,\n \"destination\" text\n);\n\nQuestion: What is Stop No., when Destination is [2778] Claisebrook Station Platforms?" }, { "role": "assistant", "content": "SELECT \"stop_no\" FROM \"platforms\" WHERE \"destination\"='[2778] claisebrook station platforms';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"platforms\" (\n \"stop_no\" text,\n \"platform\" text,\n \"line\" text,\n \"stopping_pattern\" text,\n \"destination\" text\n);\n\nQuestion: What is Stopping Pattern, when Platform is 4?" }, { "role": "assistant", "content": "SELECT \"stopping_pattern\" FROM \"platforms\" WHERE \"platform\"='4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"platforms\" (\n \"stop_no\" text,\n \"platform\" text,\n \"line\" text,\n \"stopping_pattern\" text,\n \"destination\" text\n);\n\nQuestion: What is Stop No., when Destination is Perth, and when Line is Midland?" }, { "role": "assistant", "content": "SELECT \"stop_no\" FROM \"platforms\" WHERE \"destination\"='perth' AND \"line\"='midland';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"annual_passenger_statistics_for_turku_ai\" (\n \"year\" real,\n \"domestic_passengers\" real,\n \"international_passengers\" real,\n \"total_passengers\" real,\n \"change\" text\n);\n\nQuestion: What year did the Turku Airport have a total of 116,631 domestic passengers and a total of 308,782 passengers?" }, { "role": "assistant", "content": "SELECT MAX(\"year\") FROM \"annual_passenger_statistics_for_turku_ai\" WHERE \"domestic_passengers\">'116,631' AND \"total_passengers\"='308,782';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"south_australia\" (\n \"team\" text,\n \"coach\" text,\n \"home_ground\" text,\n \"location\" text,\n \"founded\" real\n);\n\nQuestion: Which coach founded the Western Strikers team after 1963?" }, { "role": "assistant", "content": "SELECT \"coach\" FROM \"south_australia\" WHERE \"founded\">1963 AND \"team\"='western strikers';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"south_australia\" (\n \"team\" text,\n \"coach\" text,\n \"home_ground\" text,\n \"location\" text,\n \"founded\" real\n);\n\nQuestion: Who is the coach located in Oakden?" }, { "role": "assistant", "content": "SELECT \"coach\" FROM \"south_australia\" WHERE \"location\"='oakden';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"south_australia\" (\n \"team\" text,\n \"coach\" text,\n \"home_ground\" text,\n \"location\" text,\n \"founded\" real\n);\n\nQuestion: Which team has coach John Kosmina?" }, { "role": "assistant", "content": "SELECT \"team\" FROM \"south_australia\" WHERE \"coach\"='john kosmina';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"south_australia\" (\n \"team\" text,\n \"coach\" text,\n \"home_ground\" text,\n \"location\" text,\n \"founded\" real\n);\n\nQuestion: Who is the coach for the Adelaide Galaxy team?" }, { "role": "assistant", "content": "SELECT \"coach\" FROM \"south_australia\" WHERE \"team\"='adelaide galaxy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"wins\" real\n);\n\nQuestion: Count the average Wins which has a Class of 250cc, and a Year of 1972?" }, { "role": "assistant", "content": "SELECT AVG(\"wins\") FROM \"grand_prix_motorcycle_racing_results\" WHERE \"class\"='250cc' AND \"year\"=1972;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"wins\" real\n);\n\nQuestion: Name the lowest Wins which has Points of 28, and a Year smaller than 1972?" }, { "role": "assistant", "content": "SELECT MIN(\"wins\") FROM \"grand_prix_motorcycle_racing_results\" WHERE \"points\"=28 AND \"year\"<1972;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"wins\" real\n);\n\nQuestion: Name the Team which has Points larger than 9, and a Year larger than 1971, and a Class of 250cc?" }, { "role": "assistant", "content": "SELECT \"team\" FROM \"grand_prix_motorcycle_racing_results\" WHERE \"points\">9 AND \"year\">1971 AND \"class\"='250cc';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"wins\" real\n);\n\nQuestion: Name the Wins which has a Class of 350cc, and a Year smaller than 1973?" }, { "role": "assistant", "content": "SELECT SUM(\"wins\") FROM \"grand_prix_motorcycle_racing_results\" WHERE \"class\"='350cc' AND \"year\"<1973;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_prix_motorcycle_racing_results\" (\n \"year\" real,\n \"class\" text,\n \"team\" text,\n \"points\" real,\n \"wins\" real\n);\n\nQuestion: How many Points has Wins larger than 0?" }, { "role": "assistant", "content": "SELECT COUNT(\"points\") FROM \"grand_prix_motorcycle_racing_results\" WHERE \"wins\">0;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_roster\" (\n \"name\" text,\n \"height\" text,\n \"weight\" text,\n \"spike\" text,\n \"2013_club\" text\n);\n\nQuestion: SHOW THE Name who has a 2013 club of vol\u00e9ro z\u00fcrich?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"current_roster\" WHERE \"2013_club\"='vol\u00e9ro z\u00fcrich';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_roster\" (\n \"name\" text,\n \"height\" text,\n \"weight\" text,\n \"spike\" text,\n \"2013_club\" text\n);\n\nQuestion: Name the Height which has a 2013 club of wvc dynamo moscow?" }, { "role": "assistant", "content": "SELECT \"height\" FROM \"current_roster\" WHERE \"2013_club\"='wvc dynamo moscow';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_roster\" (\n \"name\" text,\n \"height\" text,\n \"weight\" text,\n \"spike\" text,\n \"2013_club\" text\n);\n\nQuestion: What kind of Spike has a Name of mia jerkov category:articles with hcards?" }, { "role": "assistant", "content": "SELECT \"spike\" FROM \"current_roster\" WHERE \"name\"='mia jerkov category:articles with hcards';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_roster\" (\n \"name\" text,\n \"height\" text,\n \"weight\" text,\n \"spike\" text,\n \"2013_club\" text\n);\n\nQuestion: Name the 2013 club which has a Name of ana grbac category:articles with hcards?" }, { "role": "assistant", "content": "SELECT \"2013_club\" FROM \"current_roster\" WHERE \"name\"='ana grbac category:articles with hcards';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_roster\" (\n \"name\" text,\n \"height\" text,\n \"weight\" text,\n \"spike\" text,\n \"2013_club\" text\n);\n\nQuestion: Name the Spike which has a Name of senna u\u0161i\u0107-jogunica category:articles with hcards?" }, { "role": "assistant", "content": "SELECT \"spike\" FROM \"current_roster\" WHERE \"name\"='senna u\u0161i\u0107-jogunica category:articles with hcards';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What was the Overall number for the player with a position of C and a round greater than 7?" }, { "role": "assistant", "content": "SELECT SUM(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"round\">7 AND \"position\"='c';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"washington_redskins_draft_history\" (\n \"round\" real,\n \"pick\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What was the Overall number that is the lowest, and has a pick greater than 9?" }, { "role": "assistant", "content": "SELECT MIN(\"overall\") FROM \"washington_redskins_draft_history\" WHERE \"pick\">9;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"career_summary\" (\n \"season\" real,\n \"series\" text,\n \"team\" text,\n \"races\" real,\n \"wins\" real,\n \"poles\" real,\n \"f_laps\" real,\n \"podiums\" real,\n \"points\" real,\n \"position\" text\n);\n\nQuestion: Which team after 2008, with less than 2 podium finished and more than 0 FLAPS, had the lowest numberof races?" }, { "role": "assistant", "content": "SELECT MIN(\"races\") FROM \"career_summary\" WHERE \"podiums\"<2 AND \"f_laps\">0 AND \"season\">2008;" } ]
[ { "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\" text\n);\n\nQuestion: what is the points when the entrant is brabham racing organisation, the year is 1964 and the chassis is brabham bt7?" }, { "role": "assistant", "content": "SELECT \"points\" FROM \"complete_formula_one_world_championship_\" WHERE \"entrant\"='brabham racing organisation' AND \"year\"=1964 AND \"chassis\"='brabham bt7';" } ]
[ { "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\" text\n);\n\nQuestion: who is the entrant when the points is 42 (45) and the chassis is brabham bt20?" }, { "role": "assistant", "content": "SELECT \"entrant\" FROM \"complete_formula_one_world_championship_\" WHERE \"points\"='42 (45)' AND \"chassis\"='brabham bt20';" } ]
[ { "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\" text\n);\n\nQuestion: how many times is the chassis brabham bt33?" }, { "role": "assistant", "content": "SELECT COUNT(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"chassis\"='brabham bt33';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"tour_de_france_stages_with_summit_finish\" (\n \"year\" real,\n \"stage\" real,\n \"start_of_stage\" text,\n \"distance_km\" text,\n \"category\" text,\n \"stage_winner\" text,\n \"yellow_jersey\" text\n);\n\nQuestion: Who was the winner in 2013?" }, { "role": "assistant", "content": "SELECT \"stage_winner\" FROM \"tour_de_france_stages_with_summit_finish\" WHERE \"year\"=2013;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"matches\" (\n \"date\" text,\n \"venue\" text,\n \"opponents\" text,\n \"score\" text,\n \"comp\" text,\n \"attendance\" text\n);\n\nQuestion: Who was the opponent at Ullevi?" }, { "role": "assistant", "content": "SELECT \"opponents\" FROM \"matches\" WHERE \"venue\"='ullevi';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"matches\" (\n \"date\" text,\n \"venue\" text,\n \"opponents\" text,\n \"score\" text,\n \"comp\" text,\n \"attendance\" text\n);\n\nQuestion: When was G\u00f6teborg the opponent with a score of 3-1?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"matches\" WHERE \"opponents\"='g\u00f6teborg' AND \"score\"='3-1';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Which Finish had a To par of +10?" }, { "role": "assistant", "content": "SELECT \"finish\" FROM \"made_the_cut\" WHERE \"to_par\"='+10';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"made_the_cut\" (\n \"player\" text,\n \"country\" text,\n \"year_s_won\" text,\n \"total\" real,\n \"to_par\" text,\n \"finish\" text\n);\n\nQuestion: Which years was there a To par of +1?" }, { "role": "assistant", "content": "SELECT \"year_s_won\" FROM \"made_the_cut\" WHERE \"to_par\"='+1';" } ]
[ { "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 \"team\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real,\n \"points\" real\n);\n\nQuestion: What were S\u00e9bastien Bourdais' lowest points when there were less than 63 laps?" }, { "role": "assistant", "content": "SELECT MIN(\"points\") FROM \"race\" WHERE \"driver\"='s\u00e9bastien bourdais' AND \"laps\"<63;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: What is Position, when Event is 60 m, and when Venue is Budapest , Hungary?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"achievements\" WHERE \"event\"='60 m' 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 \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: What is Event, when Position is 6th, and when Year is after 2006?" }, { "role": "assistant", "content": "SELECT \"event\" FROM \"achievements\" WHERE \"position\"='6th' AND \"year\">2006;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: What is the average Year, when Position is 9th, when Event is 100 m, and when Venue is Munich, Germany?" }, { "role": "assistant", "content": "SELECT AVG(\"year\") FROM \"achievements\" WHERE \"position\"='9th' AND \"event\"='100 m' AND \"venue\"='munich, germany';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: What is the Event, when Year is 2002, and when Competition is European Indoor Championships?" }, { "role": "assistant", "content": "SELECT \"event\" FROM \"achievements\" WHERE \"year\"=2002 AND \"competition\"='european indoor championships';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is Nation, when Bronze is 1, when Gold is greater than 0, and when Rank is 2?" }, { "role": "assistant", "content": "SELECT \"nation\" FROM \"medal_table\" WHERE \"bronze\"=1 AND \"gold\">0 AND \"rank\"='2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average Total, when Bronze is greater than 0, when Silver is greater than 0, when Gold is greater than 2, and when Nation is Soviet Union?" }, { "role": "assistant", "content": "SELECT AVG(\"total\") FROM \"medal_table\" WHERE \"bronze\">0 AND \"silver\">0 AND \"gold\">2 AND \"nation\"='soviet union';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average Gold, when Nation is Yugoslavia, and when Silver is greater than 0?" }, { "role": "assistant", "content": "SELECT AVG(\"gold\") FROM \"medal_table\" WHERE \"nation\"='yugoslavia' AND \"silver\">0;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average Bronze, when Total is 4, and when Silver is less than 2?" }, { "role": "assistant", "content": "SELECT AVG(\"bronze\") FROM \"medal_table\" WHERE \"total\"=4 AND \"silver\"<2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"first_qualifying_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What is the aggregate for the tie with a team 2 of Irtysh?" }, { "role": "assistant", "content": "SELECT \"agg\" FROM \"first_qualifying_round\" WHERE \"team_2\"='irtysh';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"first_qualifying_round\" (\n \"team_1\" text,\n \"agg\" text,\n \"team_2\" text,\n \"1st_leg\" text,\n \"2nd_leg\" text\n);\n\nQuestion: What was the aggregate in the match with a team 1 of Dinamo Minsk?" }, { "role": "assistant", "content": "SELECT \"agg\" FROM \"first_qualifying_round\" WHERE \"team_1\"='dinamo minsk';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: What is the Java EE compatibility of the 5.2.4 edition?" }, { "role": "assistant", "content": "SELECT \"java_ee_compatibility\" FROM \"java\" WHERE \"edition\"='5.2.4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: What is the release date for Eclipse Foundation?" }, { "role": "assistant", "content": "SELECT \"release_date\" FROM \"java\" WHERE \"vendor\"='eclipse foundation';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: Which Oracle Corporation product has a Java EE compatibility of 1.4?" }, { "role": "assistant", "content": "SELECT \"product\" FROM \"java\" WHERE \"java_ee_compatibility\"='1.4' AND \"vendor\"='oracle corporation';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: Which edition released on 2007-06-07 has a Java EE compatibility of 5?" }, { "role": "assistant", "content": "SELECT \"edition\" FROM \"java\" WHERE \"java_ee_compatibility\"='5' AND \"release_date\"='2007-06-07';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: When was Glassfish released?" }, { "role": "assistant", "content": "SELECT \"release_date\" FROM \"java\" WHERE \"product\"='glassfish';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"java\" (\n \"product\" text,\n \"vendor\" text,\n \"edition\" text,\n \"release_date\" text,\n \"java_ee_compatibility\" text,\n \"license\" text\n);\n\nQuestion: Which licence has a release date of 2009-08?" }, { "role": "assistant", "content": "SELECT \"license\" FROM \"java\" WHERE \"release_date\"='2009-08';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"surface\" text,\n \"week\" text,\n \"winner\" text,\n \"finalist\" text,\n \"semifinalists\" text\n);\n\nQuestion: WHO ARE THE SEMIFINALISTS FOR TOURNAMENT OF PARIS?" }, { "role": "assistant", "content": "SELECT \"semifinalists\" FROM \"singles\" WHERE \"tournament\"='paris';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"tournament\" text,\n \"surface\" text,\n \"week\" text,\n \"winner\" text,\n \"finalist\" text,\n \"semifinalists\" text\n);\n\nQuestion: WHO WAS THE SEMIFINALISTS FOR THE HAMBURG TOURNAMENT?" }, { "role": "assistant", "content": "SELECT \"semifinalists\" FROM \"singles\" WHERE \"tournament\"='hamburg';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"scottish_cup\" (\n \"date\" text,\n \"round\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: Which opponent had a round of SF?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"scottish_cup\" WHERE \"round\"='sf';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"scottish_cup\" (\n \"date\" text,\n \"round\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the result when the opponent was Celtic?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"scottish_cup\" WHERE \"opponent\"='celtic';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"scottish_cup\" (\n \"date\" text,\n \"round\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the result for round r3?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"scottish_cup\" WHERE \"round\"='r3';" } ]