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 \"kaikoura_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: Name the Years of schools with a Roll Larger than 23 and a Decile greater than 5." }, { "role": "assistant", "content": "SELECT \"years\" FROM \"kaikoura_district\" WHERE \"roll\">23 AND \"decile\">5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"kaikoura_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 total number of Rolls of State schools in Hapuku with a Decile greater than 4?" }, { "role": "assistant", "content": "SELECT COUNT(\"roll\") FROM \"kaikoura_district\" WHERE \"authority\"='state' AND \"area\"='hapuku' AND \"decile\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"senate_composition_before_the_elections\" (\n \"d_48\" text,\n \"d_47\" text,\n \"d_46\" text,\n \"d_45\" text,\n \"d_44\" text,\n \"d_43\" text,\n \"d_42\" text,\n \"d_41\" text\n);\n\nQuestion: What is the D45 associated with a D42 of r 22?" }, { "role": "assistant", "content": "SELECT \"d_45\" FROM \"senate_composition_before_the_elections\" WHERE \"d_42\"='r 22';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"senate_composition_before_the_elections\" (\n \"d_48\" text,\n \"d_47\" text,\n \"d_46\" text,\n \"d_45\" text,\n \"d_44\" text,\n \"d_43\" text,\n \"d_42\" text,\n \"d_41\" text\n);\n\nQuestion: What is the D43 associated with a D41 of r 21?" }, { "role": "assistant", "content": "SELECT \"d_43\" FROM \"senate_composition_before_the_elections\" WHERE \"d_41\"='r 21';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"senate_composition_before_the_elections\" (\n \"d_48\" text,\n \"d_47\" text,\n \"d_46\" text,\n \"d_45\" text,\n \"d_44\" text,\n \"d_43\" text,\n \"d_42\" text,\n \"d_41\" text\n);\n\nQuestion: What is the D42 associated with a D47 of d 27?" }, { "role": "assistant", "content": "SELECT \"d_42\" FROM \"senate_composition_before_the_elections\" WHERE \"d_47\"='d 27';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"senate_composition_before_the_elections\" (\n \"d_48\" text,\n \"d_47\" text,\n \"d_46\" text,\n \"d_45\" text,\n \"d_44\" text,\n \"d_43\" text,\n \"d_42\" text,\n \"d_41\" text\n);\n\nQuestion: What is the D43 associated with a D41 of r 16?" }, { "role": "assistant", "content": "SELECT \"d_43\" FROM \"senate_composition_before_the_elections\" WHERE \"d_41\"='r 16';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What is the record for the game when the loss was hargan (14\u201313)?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"game_log\" WHERE \"loss\"='hargan (14\u201313)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What is the record for the game with a score of 7\u20135?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"game_log\" WHERE \"score\"='7\u20135';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What date was the game with loss of Aker (3\u20138)?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"game_log\" WHERE \"loss\"='aker (3\u20138)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What team was the opponent when the score was 7\u20131?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"score\"='7\u20131';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the score when the opponent was the Orioles and the loss shows morehead (5\u20134)?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"game_log\" WHERE \"opponent\"='orioles' AND \"loss\"='morehead (5\u20134)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Name the opponent with a record of 60-61" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"record\"='60-61';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"final_results_2007_fai_world_grand_prix\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"score\" text,\n \"perfection\" text\n);\n\nQuestion: Who had a perfection percentage of 77.96%?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"final_results_2007_fai_world_grand_prix\" WHERE \"perfection\"='77.96%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"final_results_2007_fai_world_grand_prix\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"score\" text,\n \"perfection\" text\n);\n\nQuestion: What was the rank of Svetlana Fedorenko?" }, { "role": "assistant", "content": "SELECT \"rank\" FROM \"final_results_2007_fai_world_grand_prix\" WHERE \"name\"='svetlana fedorenko';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"final_results_2007_fai_world_grand_prix\" (\n \"rank\" real,\n \"name\" text,\n \"nationality\" text,\n \"score\" text,\n \"perfection\" text\n);\n\nQuestion: Who had a perfection percentage of 73.24%?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"final_results_2007_fai_world_grand_prix\" WHERE \"perfection\"='73.24%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"record\" text\n);\n\nQuestion: What was the score of the game on June 1?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"game_log\" WHERE \"date\"='june 1';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What was the score against andrei pavel?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"futures_and_challengers_singles_titles\" WHERE \"opponent\"='andrei pavel';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: When was the tournament of bologna?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"futures_and_challengers_singles_titles\" WHERE \"tournament\"='bologna';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Who played on clay and had a score of 6\u20131, 7\u20136?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"futures_and_challengers_singles_titles\" WHERE \"surface\"='clay' AND \"score\"='6\u20131, 7\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Who played on clay on 3 march 2012?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"futures_and_challengers_singles_titles\" WHERE \"surface\"='clay' AND \"date\"='3 march 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What was the score against fabrice martin?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"futures_and_challengers_singles_titles\" WHERE \"opponent\"='fabrice martin';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"futures_and_challengers_singles_titles\" (\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: What was the surface of the score of 7\u20135, 3\u20136, 7\u20136?" }, { "role": "assistant", "content": "SELECT \"surface\" FROM \"futures_and_challengers_singles_titles\" WHERE \"score\"='7\u20135, 3\u20136, 7\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cardinal_electors\" (\n \"elector\" text,\n \"order\" text,\n \"title\" text,\n \"elevated\" text,\n \"elevator\" text\n);\n\nQuestion: What's the Order with an Elector of Marino Bulcani?" }, { "role": "assistant", "content": "SELECT \"order\" FROM \"cardinal_electors\" WHERE \"elector\"='marino bulcani';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cardinal_electors\" (\n \"elector\" text,\n \"order\" text,\n \"title\" text,\n \"elevated\" text,\n \"elevator\" text\n);\n\nQuestion: What's the Elevator that has Elevated: 1378, September 18, an Order of Cardinal-Priest, and an Elector of Poncello Orsini?" }, { "role": "assistant", "content": "SELECT \"elevator\" FROM \"cardinal_electors\" WHERE \"elevated\"='1378, september 18' AND \"order\"='cardinal-priest' AND \"elector\"='poncello orsini';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cardinal_electors\" (\n \"elector\" text,\n \"order\" text,\n \"title\" text,\n \"elevated\" text,\n \"elevator\" text\n);\n\nQuestion: What is listed as the Elector with the Title of Deacon of S. Maria in Domnica?" }, { "role": "assistant", "content": "SELECT \"elector\" FROM \"cardinal_electors\" WHERE \"title\"='deacon of s. maria in domnica';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"cardinal_electors\" (\n \"elector\" text,\n \"order\" text,\n \"title\" text,\n \"elevated\" text,\n \"elevator\" text\n);\n\nQuestion: What's listed for the Elevated category that has an Order of Cardinal-Bishop?" }, { "role": "assistant", "content": "SELECT \"elevated\" FROM \"cardinal_electors\" WHERE \"order\"='cardinal-bishop';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2006_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: The Milford School has what Division Record?" }, { "role": "assistant", "content": "SELECT \"division_record\" FROM \"2006_regular_season_football_standings\" WHERE \"school\"='milford';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2006_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 name of the School of the Sussex Tech's Team?" }, { "role": "assistant", "content": "SELECT \"team\" FROM \"2006_regular_season_football_standings\" WHERE \"school\"='sussex tech';" } ]
[ { "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_us\" real\n);\n\nQuestion: What was Arnold Palmer's score in the tournamnet?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"final_leaderboard\" WHERE \"player\"='arnold palmer';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"term_in_office\" text\n);\n\nQuestion: What the name of Peter White's party?" }, { "role": "assistant", "content": "SELECT \"party\" FROM \"see_also\" WHERE \"member\"='peter white';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"term_in_office\" text\n);\n\nQuestion: What term did an Electorate of indi have in office?" }, { "role": "assistant", "content": "SELECT \"term_in_office\" FROM \"see_also\" WHERE \"electorate\"='indi';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"term_in_office\" text\n);\n\nQuestion: What term did hon ralph hunt serve in office?" }, { "role": "assistant", "content": "SELECT \"term_in_office\" FROM \"see_also\" WHERE \"member\"='hon ralph hunt';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"member\" text,\n \"party\" text,\n \"electorate\" text,\n \"state\" text,\n \"term_in_office\" text\n);\n\nQuestion: What party is Peter Fisher from Vic serve in office?" }, { "role": "assistant", "content": "SELECT \"party\" FROM \"see_also\" WHERE \"state\"='vic' AND \"member\"='peter fisher';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"24_hours_of_le_mans_results\" (\n \"year\" real,\n \"team\" text,\n \"co_drivers\" text,\n \"class\" text,\n \"laps\" real,\n \"pos\" text,\n \"class_pos\" text\n);\n\nQuestion: How many laps were done in 2012?" }, { "role": "assistant", "content": "SELECT SUM(\"laps\") FROM \"24_hours_of_le_mans_results\" WHERE \"year\"=2012;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_6_6\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: On what day was the score of 1\u20136 6\u20131 3\u20136 achieved?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"singles_6_6\" WHERE \"score\"='1\u20136 6\u20131 3\u20136';" } ]
[ { "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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the average gold for czech republic and bronze less than 1 when total is less than 14" }, { "role": "assistant", "content": "SELECT AVG(\"gold\") FROM \"medal_table\" WHERE \"total\"<14 AND \"bronze\"<1 AND \"nation\"='czech republic';" } ]
[ { "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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the highest rank when silver is 4 and bronze is less than 3" }, { "role": "assistant", "content": "SELECT MAX(\"rank\") FROM \"medal_table\" WHERE \"silver\"=4 AND \"bronze\"<3;" } ]
[ { "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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: Name the total number of total for bronze of 4 and silver more than 6" }, { "role": "assistant", "content": "SELECT COUNT(\"total\") FROM \"medal_table\" WHERE \"bronze\"=4 AND \"silver\">6;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"doubles_19_5_14\" (\n \"outcome\" text,\n \"date\" text,\n \"tournament\" text,\n \"surface\" text,\n \"partner\" text,\n \"opponents_in_the_final\" text,\n \"score_in_the_final\" text\n);\n\nQuestion: When the Surface was Carpet (i), what was the Outcome?" }, { "role": "assistant", "content": "SELECT \"outcome\" FROM \"doubles_19_5_14\" WHERE \"surface\"='carpet (i)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurolaul_26_january_2002\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"votes\" real,\n \"place\" real\n);\n\nQuestion: What is the draw number of the song with a place lower than 6 and more than 38 votes?" }, { "role": "assistant", "content": "SELECT SUM(\"draw\") FROM \"eurolaul_26_january_2002\" WHERE \"place\">6 AND \"votes\">38;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurolaul_26_january_2002\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"votes\" real,\n \"place\" real\n);\n\nQuestion: What is the total number of votes Sahlene with a place below 1 has?" }, { "role": "assistant", "content": "SELECT COUNT(\"votes\") FROM \"eurolaul_26_january_2002\" WHERE \"artist\"='sahlene' AND \"place\">1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurolaul_26_january_2002\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"votes\" real,\n \"place\" real\n);\n\nQuestion: What is the highest place of the song with 38 votes and a draw great than 3?" }, { "role": "assistant", "content": "SELECT MAX(\"place\") FROM \"eurolaul_26_january_2002\" WHERE \"votes\"=38 AND \"draw\">3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurolaul_26_january_2002\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"votes\" real,\n \"place\" real\n);\n\nQuestion: How many votes did Yvetta Kadakas & Ivo Linna, who had less than 4 draws, have?" }, { "role": "assistant", "content": "SELECT SUM(\"votes\") FROM \"eurolaul_26_january_2002\" WHERE \"draw\"<4 AND \"artist\"='yvetta kadakas & ivo linna';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"indianapolis_500\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What year was there a finish of 3?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"indianapolis_500\" WHERE \"finish\"='3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"indianapolis_500\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: What year was the start 33?" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"indianapolis_500\" WHERE \"start\"='33';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"indianapolis_500\" (\n \"year\" real,\n \"chassis\" text,\n \"engine\" text,\n \"start\" text,\n \"finish\" text,\n \"team\" text\n);\n\nQuestion: When was there a team of Simon and the start was 3?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"indianapolis_500\" WHERE \"team\"='simon' AND \"start\"='3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"completed\" (\n \"rank\" real,\n \"city\" text,\n \"roof_m\" real,\n \"spire_m\" text,\n \"floors\" real,\n \"built\" real\n);\n\nQuestion: What's the name of the 1985 city with a Spire (m) of 105, and a Roof (m) smaller than 96?" }, { "role": "assistant", "content": "SELECT \"city\" FROM \"completed\" WHERE \"spire_m\"='105' AND \"roof_m\"<96 AND \"built\"=1985;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"completed\" (\n \"rank\" real,\n \"city\" text,\n \"roof_m\" real,\n \"spire_m\" text,\n \"floors\" real,\n \"built\" real\n);\n\nQuestion: What's the average number of floors that were built in 2004, and have a roof (m) of 106?" }, { "role": "assistant", "content": "SELECT AVG(\"floors\") FROM \"completed\" WHERE \"built\"=2004 AND \"roof_m\"=106;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"completed\" (\n \"rank\" real,\n \"city\" text,\n \"roof_m\" real,\n \"spire_m\" text,\n \"floors\" real,\n \"built\" real\n);\n\nQuestion: What's the total number of floors built after 2006, and have a rank of 12?" }, { "role": "assistant", "content": "SELECT SUM(\"floors\") FROM \"completed\" WHERE \"built\">2006 AND \"rank\"=12;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_cup\" (\n \"date\" text,\n \"round\" text,\n \"opponents\" text,\n \"h_a\" text,\n \"result_f_a\" text,\n \"attendance\" real\n);\n\nQuestion: What is the sum of attendance for H/A values of \"n\"?" }, { "role": "assistant", "content": "SELECT SUM(\"attendance\") FROM \"league_cup\" WHERE \"h_a\"='n';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"outcome\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Name the score which has opponent of stefano galvani" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"singles\" WHERE \"opponent\"='stefano galvani';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"outcome\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Name the score with opponent of javier genaro-martinez" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"singles\" WHERE \"opponent\"='javier genaro-martinez';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"outcome\" text,\n \"tournament\" text,\n \"surface\" text,\n \"opponent\" text,\n \"score\" text\n);\n\nQuestion: Name the outcome for dunlop world challenge" }, { "role": "assistant", "content": "SELECT \"outcome\" FROM \"singles\" WHERE \"tournament\"='dunlop world challenge';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1998\" (\n \"date\" text,\n \"visiting_team\" text,\n \"final_score\" text,\n \"host_team\" text,\n \"stadium\" text\n);\n\nQuestion: Who was the visiting team on December 6?" }, { "role": "assistant", "content": "SELECT \"visiting_team\" FROM \"1998\" WHERE \"date\"='december 6';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1998\" (\n \"date\" text,\n \"visiting_team\" text,\n \"final_score\" text,\n \"host_team\" text,\n \"stadium\" text\n);\n\nQuestion: Who was the host team on October 4?" }, { "role": "assistant", "content": "SELECT \"host_team\" FROM \"1998\" WHERE \"date\"='october 4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_subsidiaries\" (\n \"date\" text,\n \"company\" text,\n \"business\" text,\n \"country\" text,\n \"value_usd\" text\n);\n\nQuestion: In New Zealand, what's the value that has an unknown date and is an energy business?" }, { "role": "assistant", "content": "SELECT \"value_usd\" FROM \"list_of_subsidiaries\" WHERE \"date\"='unknown' AND \"business\"='energy' AND \"country\"='new zealand';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_subsidiaries\" (\n \"date\" text,\n \"company\" text,\n \"business\" text,\n \"country\" text,\n \"value_usd\" text\n);\n\nQuestion: What company has an unknown date and is an energy business?" }, { "role": "assistant", "content": "SELECT \"company\" FROM \"list_of_subsidiaries\" WHERE \"business\"='energy' AND \"date\"='unknown';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_subsidiaries\" (\n \"date\" text,\n \"company\" text,\n \"business\" text,\n \"country\" text,\n \"value_usd\" text\n);\n\nQuestion: In the United Kingdom, what company has an unknown date and is an energy business?" }, { "role": "assistant", "content": "SELECT \"company\" FROM \"list_of_subsidiaries\" WHERE \"business\"='energy' AND \"date\"='unknown' AND \"country\"='united kingdom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_subsidiaries\" (\n \"date\" text,\n \"company\" text,\n \"business\" text,\n \"country\" text,\n \"value_usd\" text\n);\n\nQuestion: For the United Kingdom, what's the date?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"list_of_subsidiaries\" WHERE \"country\"='united kingdom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_subsidiaries\" (\n \"date\" text,\n \"company\" text,\n \"business\" text,\n \"country\" text,\n \"value_usd\" text\n);\n\nQuestion: For the Enernoc Australia Pty Ltd, what's the country with an unknown date?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"list_of_subsidiaries\" WHERE \"date\"='unknown' AND \"company\"='enernoc australia pty ltd';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"goal\" real,\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: Which date is associated with a venue of Luxembourg?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"international_goals\" WHERE \"venue\"='luxembourg';" } ]
[ { "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 with a Kurtis Kraft 500a chassis, and less than 1.5 points?" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"chassis\"='kurtis kraft 500a' AND \"points\"<1.5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"complete_formula_one_world_championship_\" (\n \"year\" real,\n \"entrant\" text,\n \"chassis\" text,\n \"engine\" text,\n \"points\" real\n);\n\nQuestion: What is the year with a kurtis kraft 500a chassis?" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"complete_formula_one_world_championship_\" WHERE \"chassis\"='kurtis kraft 500a';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"indianapolis_colts_draft_history\" (\n \"round\" real,\n \"pick_num\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the lowest Pick # of Saint Vincent College?" }, { "role": "assistant", "content": "SELECT MIN(\"pick_num\") FROM \"indianapolis_colts_draft_history\" WHERE \"college\"='saint vincent college';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"indianapolis_colts_draft_history\" (\n \"round\" real,\n \"pick_num\" real,\n \"overall\" real,\n \"name\" text,\n \"position\" text,\n \"college\" text\n);\n\nQuestion: What is the Overall for Pick # less than 5 Jack Harmon?" }, { "role": "assistant", "content": "SELECT MIN(\"overall\") FROM \"indianapolis_colts_draft_history\" WHERE \"name\"='jack harmon' AND \"pick_num\"<5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurostat_data_for_2009\" (\n \"rank\" text,\n \"region\" text,\n \"total_gdp_bn\" text,\n \"pct_growth\" text,\n \"per_capita\" text\n);\n\nQuestion: Which rank has a Total GDP (\u20ac bn) of \u20ac11.243??" }, { "role": "assistant", "content": "SELECT \"rank\" FROM \"eurostat_data_for_2009\" WHERE \"total_gdp_bn\"='\u20ac11.243';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurostat_data_for_2009\" (\n \"rank\" text,\n \"region\" text,\n \"total_gdp_bn\" text,\n \"pct_growth\" text,\n \"per_capita\" text\n);\n\nQuestion: What is the Region that has a Total GDP (\u20ac bn ) of \u20ac11,745.353?" }, { "role": "assistant", "content": "SELECT \"region\" FROM \"eurostat_data_for_2009\" WHERE \"total_gdp_bn\"='\u20ac11,745.353';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurostat_data_for_2009\" (\n \"rank\" text,\n \"region\" text,\n \"total_gdp_bn\" text,\n \"pct_growth\" text,\n \"per_capita\" text\n);\n\nQuestion: Which Region that has a growth of \u22123.6%?" }, { "role": "assistant", "content": "SELECT \"region\" FROM \"eurostat_data_for_2009\" WHERE \"pct_growth\"='\u22123.6';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"eurostat_data_for_2009\" (\n \"rank\" text,\n \"region\" text,\n \"total_gdp_bn\" text,\n \"pct_growth\" text,\n \"per_capita\" text\n);\n\nQuestion: What is the per capita of Greece?" }, { "role": "assistant", "content": "SELECT \"per_capita\" FROM \"eurostat_data_for_2009\" WHERE \"region\"='greece';" } ]
[ { "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 fewest number of silver medals received by a nation who received 40 bronze medals and more than 42 gold medals?" }, { "role": "assistant", "content": "SELECT MIN(\"silver\") FROM \"medal_table\" WHERE \"bronze\"=40 AND \"gold\">42;" } ]
[ { "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 lowest number of silver medals received by Austria when they receive more than 3 total medals, more than 22 bronze medals, and fewer than 395 gold medals?" }, { "role": "assistant", "content": "SELECT MIN(\"silver\") FROM \"medal_table\" WHERE \"total\">3 AND \"bronze\">22 AND \"gold\"<395 AND \"nation\"='austria';" } ]
[ { "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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the average number of silver medals with more than 6 gold meals and less than 5 bronze medals?" }, { "role": "assistant", "content": "SELECT AVG(\"silver\") FROM \"medal_table\" WHERE \"gold\">6 AND \"bronze\"<5;" } ]
[ { "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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many ranks are for Switzerland with more than 2 total medals?" }, { "role": "assistant", "content": "SELECT COUNT(\"rank\") FROM \"medal_table\" WHERE \"nation\"='switzerland' AND \"total\">2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the event of the match with a round larger than 2 and ended with a method of ko (kick)?" }, { "role": "assistant", "content": "SELECT \"event\" FROM \"mixed_martial_arts_record\" WHERE \"round\">2 AND \"method\"='ko (kick)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the method of the match after round 1 in the k-1 andy memorial 2001 japan gp final?" }, { "role": "assistant", "content": "SELECT \"method\" FROM \"mixed_martial_arts_record\" WHERE \"round\">1 AND \"event\"='k-1 andy memorial 2001 japan gp final';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the highest round of the match with Rene Rooze as the opponent in Saitama, Japan?" }, { "role": "assistant", "content": "SELECT MAX(\"round\") FROM \"mixed_martial_arts_record\" WHERE \"opponent\"='rene rooze' AND \"location\"='saitama, japan';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"mixed_martial_arts_record\" (\n \"res\" text,\n \"record\" text,\n \"opponent\" text,\n \"method\" text,\n \"event\" text,\n \"round\" real,\n \"time\" text,\n \"location\" text\n);\n\nQuestion: What is the highest round of the match with a time of 0:57?" }, { "role": "assistant", "content": "SELECT MAX(\"round\") FROM \"mixed_martial_arts_record\" WHERE \"time\"='0:57';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2011_2012_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many points did the Club score that has a try bonus of 7 and 52 tries for ?" }, { "role": "assistant", "content": "SELECT \"points_for\" FROM \"2011_2012_table\" WHERE \"tries_for\"='52' AND \"try_bonus\"='7';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2011_2012_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: What is the Losing bonus of the club that has 80 tries against ?" }, { "role": "assistant", "content": "SELECT \"losing_bonus\" FROM \"2011_2012_table\" WHERE \"tries_against\"='80';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2011_2012_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many tries for does waunarlwydd rfc have ?" }, { "role": "assistant", "content": "SELECT \"tries_for\" FROM \"2011_2012_table\" WHERE \"club\"='waunarlwydd rfc';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2011_2012_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many losses did the club with 47 points have ?" }, { "role": "assistant", "content": "SELECT \"lost\" FROM \"2011_2012_table\" WHERE \"points\"='47';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2011_2012_table\" (\n \"club\" text,\n \"played\" text,\n \"drawn\" text,\n \"lost\" text,\n \"points_for\" text,\n \"points_against\" text,\n \"tries_for\" text,\n \"tries_against\" text,\n \"try_bonus\" text,\n \"losing_bonus\" text,\n \"points\" text\n);\n\nQuestion: How many points against does the club that has a try bonus of 6 and tries against of 54 have ?" }, { "role": "assistant", "content": "SELECT \"points_against\" FROM \"2011_2012_table\" WHERE \"try_bonus\"='6' AND \"tries_against\"='54';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"24_hours_of_le_mans_results\" (\n \"year\" real,\n \"team\" text,\n \"co_drivers\" text,\n \"class\" text,\n \"laps\" real,\n \"pos\" text,\n \"class_pos\" text\n);\n\nQuestion: Who were the co-drivers in 2008?" }, { "role": "assistant", "content": "SELECT \"co_drivers\" FROM \"24_hours_of_le_mans_results\" WHERE \"year\"=2008;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"24_hours_of_le_mans_results\" (\n \"year\" real,\n \"team\" text,\n \"co_drivers\" text,\n \"class\" text,\n \"laps\" real,\n \"pos\" text,\n \"class_pos\" text\n);\n\nQuestion: What was the position in 2006?" }, { "role": "assistant", "content": "SELECT \"pos\" FROM \"24_hours_of_le_mans_results\" WHERE \"year\"=2006;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"24_hours_of_le_mans_results\" (\n \"year\" real,\n \"team\" text,\n \"co_drivers\" text,\n \"class\" text,\n \"laps\" real,\n \"pos\" text,\n \"class_pos\" text\n);\n\nQuestion: What was the class when there were 325 laps?" }, { "role": "assistant", "content": "SELECT \"class\" FROM \"24_hours_of_le_mans_results\" WHERE \"laps\"=325;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"24_hours_of_le_mans_results\" (\n \"year\" real,\n \"team\" text,\n \"co_drivers\" text,\n \"class\" text,\n \"laps\" real,\n \"pos\" text,\n \"class_pos\" text\n);\n\nQuestion: What was the position in a year after 2005 with a class position of 5th?" }, { "role": "assistant", "content": "SELECT \"pos\" FROM \"24_hours_of_le_mans_results\" WHERE \"year\">2005 AND \"class_pos\"='5th';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the English title of the film from 2001?" }, { "role": "assistant", "content": "SELECT \"english_title\" FROM \"2000s\" WHERE \"year\"=2001;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the original title of the film from Japan/Taiwan before 2003?" }, { "role": "assistant", "content": "SELECT \"original_title\" FROM \"2000s\" WHERE \"year\"<2003 AND \"country\"='japan/taiwan';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the English title of the film directed by Fernando Meirelles?" }, { "role": "assistant", "content": "SELECT \"english_title\" FROM \"2000s\" WHERE \"director_s\"='fernando meirelles';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the country of the original title Cidade de deus?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"2000s\" WHERE \"original_title\"='cidade de deus';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the earliest year of a film from Mexico?" }, { "role": "assistant", "content": "SELECT MIN(\"year\") FROM \"2000s\" WHERE \"country\"='mexico';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2000s\" (\n \"year\" real,\n \"english_title\" text,\n \"original_title\" text,\n \"country\" text,\n \"director_s\" text\n);\n\nQuestion: What is the average year of the film from France/Hong Kong?" }, { "role": "assistant", "content": "SELECT AVG(\"year\") FROM \"2000s\" WHERE \"country\"='france/hong kong';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: Name the country for t3 place" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"second_round\" WHERE \"place\"='t3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: Name the country with +2 to par" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"second_round\" WHERE \"to_par\"='+2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: Name the to par for colin montgomerie" }, { "role": "assistant", "content": "SELECT \"to_par\" FROM \"second_round\" WHERE \"player\"='colin montgomerie';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"second_round\" (\n \"place\" text,\n \"player\" text,\n \"country\" text,\n \"score\" text,\n \"to_par\" text\n);\n\nQuestion: Name the score for scotland" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"second_round\" WHERE \"country\"='scotland';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"main_list\" (\n \"island\" text,\n \"location\" text,\n \"area_ha\" real,\n \"population\" real,\n \"height_m\" real\n);\n\nQuestion: What island has a population over 76, a height over 210, and an area larger than 12068?" }, { "role": "assistant", "content": "SELECT \"island\" FROM \"main_list\" WHERE \"population\">76 AND \"height_m\">210 AND \"area_ha\">12068;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"main_list\" (\n \"island\" text,\n \"location\" text,\n \"area_ha\" real,\n \"population\" real,\n \"height_m\" real\n);\n\nQuestion: What is the highest population of Trondra Island in the Scalloway Islands?" }, { "role": "assistant", "content": "SELECT MAX(\"population\") FROM \"main_list\" WHERE \"location\"='scalloway islands' AND \"island\"='trondra';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rugby_spain_internationals_1989\" (\n \"first_game\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"percentage\" text\n);\n\nQuestion: How many matches were drawn associated with a percentage of 7.14% and more than 12 losses?" }, { "role": "assistant", "content": "SELECT COUNT(\"drawn\") FROM \"rugby_spain_internationals_1989\" WHERE \"percentage\"='7.14%' AND \"lost\">12;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"rugby_spain_internationals_1989\" (\n \"first_game\" real,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"percentage\" text\n);\n\nQuestion: Which percentage has a first game before 1997, fewer than 2 losses, and fewer than 5 matches played?" }, { "role": "assistant", "content": "SELECT \"percentage\" FROM \"rugby_spain_internationals_1989\" WHERE \"first_game\"<1997 AND \"lost\"<2 AND \"played\"<5;" } ]