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 \"by_clubs\" (\n \"team\" text,\n \"matches\" real,\n \"wins\" real,\n \"wins_pct\" text,\n \"draws\" real,\n \"draws_pct\" text,\n \"losses\" real,\n \"losses_pct\" text,\n \"against\" real,\n \"for_against_ratio\" text\n);\n\nQuestion: What are the total losses with 2 matches, 2 against, 0% of draws and less than 1 wins?" }, { "role": "assistant", "content": "SELECT SUM(\"losses\") FROM \"by_clubs\" WHERE \"matches\"=2 AND \"against\"=2 AND \"draws_pct\"='0%' AND \"wins\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"by_clubs\" (\n \"team\" text,\n \"matches\" real,\n \"wins\" real,\n \"wins_pct\" text,\n \"draws\" real,\n \"draws_pct\" text,\n \"losses\" real,\n \"losses_pct\" text,\n \"against\" real,\n \"for_against_ratio\" text\n);\n\nQuestion: What is the sum on wins with an against ratio of 0.83, and more than 1 loss?" }, { "role": "assistant", "content": "SELECT SUM(\"wins\") FROM \"by_clubs\" WHERE \"for_against_ratio\"='0.83' AND \"losses\">1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"date_outgoing\" text,\n \"reason_of_departure\" text,\n \"replaced_by\" text,\n \"date_of_replacement\" text\n);\n\nQuestion: Why did the manager who departed on August 1, 2008 leave?" }, { "role": "assistant", "content": "SELECT \"reason_of_departure\" FROM \"managerial_changes\" WHERE \"date_outgoing\"='august 1, 2008';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"date_outgoing\" text,\n \"reason_of_departure\" text,\n \"replaced_by\" text,\n \"date_of_replacement\" text\n);\n\nQuestion: On what date did the manager for PSIS Semarang take over for the manager that was sacked?" }, { "role": "assistant", "content": "SELECT \"date_of_replacement\" FROM \"managerial_changes\" WHERE \"reason_of_departure\"='sacked' AND \"team\"='psis semarang';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"date_outgoing\" text,\n \"reason_of_departure\" text,\n \"replaced_by\" text,\n \"date_of_replacement\" text\n);\n\nQuestion: Why did the manager who departed on August 1, 2008 leave?" }, { "role": "assistant", "content": "SELECT \"reason_of_departure\" FROM \"managerial_changes\" WHERE \"date_outgoing\"='august 1, 2008';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"date_outgoing\" text,\n \"reason_of_departure\" text,\n \"replaced_by\" text,\n \"date_of_replacement\" text\n);\n\nQuestion: When did Peter Butler leave his team?" }, { "role": "assistant", "content": "SELECT \"date_outgoing\" FROM \"managerial_changes\" WHERE \"outgoing_manager\"='peter butler';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"managerial_changes\" (\n \"team\" text,\n \"outgoing_manager\" text,\n \"date_outgoing\" text,\n \"reason_of_departure\" text,\n \"replaced_by\" text,\n \"date_of_replacement\" text\n);\n\nQuestion: When did the manager take over for the manager that left on August 20, 2008?" }, { "role": "assistant", "content": "SELECT \"date_of_replacement\" FROM \"managerial_changes\" WHERE \"date_outgoing\"='august 20, 2008';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"competition_record\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: In which competition(s) did Ilju\u0161t\u0161enko jump 1.90 m?" }, { "role": "assistant", "content": "SELECT \"competition\" FROM \"competition_record\" WHERE \"notes\"='1.90 m';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"competition_record\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: In which position did Ilju\u0161t\u0161enko finish in the European Championships held prior to 2008?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"competition_record\" WHERE \"year\"<2008 AND \"competition\"='european championships';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"competition_record\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"notes\" text\n);\n\nQuestion: In what year did Ilju\u0161t\u0161enko compete in Barcelona, Spain?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"competition_record\" WHERE \"venue\"='barcelona, spain';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"assembly_segments\" (\n \"constituency_number\" text,\n \"name\" text,\n \"reserved_for_sc_st_none\" text,\n \"district\" text,\n \"number_of_electorates_2009\" real\n);\n\nQuestion: What's the number of electorates for constituency number 56?" }, { "role": "assistant", "content": "SELECT SUM(\"number_of_electorates_2009\") FROM \"assembly_segments\" WHERE \"constituency_number\"='56';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"assembly_segments\" (\n \"constituency_number\" text,\n \"name\" text,\n \"reserved_for_sc_st_none\" text,\n \"district\" text,\n \"number_of_electorates_2009\" real\n);\n\nQuestion: What's the constituency number for Damoh with more than 173,217 electorates?" }, { "role": "assistant", "content": "SELECT \"constituency_number\" FROM \"assembly_segments\" WHERE \"number_of_electorates_2009\">'173,217' AND \"name\"='damoh';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"squad\" (\n \"name\" text,\n \"tests\" real,\n \"club\" text,\n \"career_caps\" real,\n \"tour_apps\" real,\n \"position\" text\n);\n\nQuestion: What is the tour Apps when the career caps show 15?" }, { "role": "assistant", "content": "SELECT \"tour_apps\" FROM \"squad\" WHERE \"career_caps\"=15;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"squad\" (\n \"name\" text,\n \"tests\" real,\n \"club\" text,\n \"career_caps\" real,\n \"tour_apps\" real,\n \"position\" text\n);\n\nQuestion: What is the number of career caps for a full back, when tour Apps is smaller than 29?" }, { "role": "assistant", "content": "SELECT COUNT(\"career_caps\") FROM \"squad\" WHERE \"position\"='full back' AND \"tour_apps\"<29;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"squad\" (\n \"name\" text,\n \"tests\" real,\n \"club\" text,\n \"career_caps\" real,\n \"tour_apps\" real,\n \"position\" text\n);\n\nQuestion: What is the career caps for half-back, when tests is more than 3?" }, { "role": "assistant", "content": "SELECT \"career_caps\" FROM \"squad\" WHERE \"position\"='half-back' AND \"tests\">3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"squad\" (\n \"name\" text,\n \"tests\" real,\n \"club\" text,\n \"career_caps\" real,\n \"tour_apps\" real,\n \"position\" text\n);\n\nQuestion: What name has tour Apps larger than 7, tests larger than 4, and a Career caps of 20?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"squad\" WHERE \"tour_apps\">7 AND \"tests\">4 AND \"career_caps\"=20;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results\" (\n \"driver\" text,\n \"entrant\" text,\n \"constructor\" text,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What constructor has a grid less than 21, and time/retired of engine?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"results\" WHERE \"grid\"<21 AND \"time_retired\"='engine';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results\" (\n \"driver\" text,\n \"entrant\" text,\n \"constructor\" text,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: When the entrant is fred saunders what is the driver?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"results\" WHERE \"entrant\"='fred saunders';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results\" (\n \"driver\" text,\n \"entrant\" text,\n \"constructor\" text,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What's the lowest grid with and entrant of fred saunders?" }, { "role": "assistant", "content": "SELECT MIN(\"grid\") FROM \"results\" WHERE \"entrant\"='fred saunders';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results\" (\n \"driver\" text,\n \"entrant\" text,\n \"constructor\" text,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the time/retired for the driver emerson fittipaldi?" }, { "role": "assistant", "content": "SELECT \"time_retired\" FROM \"results\" WHERE \"driver\"='emerson fittipaldi';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"music\" (\n \"title\" text,\n \"type\" text,\n \"artist\" text,\n \"label\" text,\n \"standard_number\" text,\n \"release_date\" text\n);\n\nQuestion: Which Artist has the Label of Columbia and the Standard number of COCC-72073?" }, { "role": "assistant", "content": "SELECT \"artist\" FROM \"music\" WHERE \"label\"='columbia' AND \"standard_number\"='cocc-72073';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"music\" (\n \"title\" text,\n \"type\" text,\n \"artist\" text,\n \"label\" text,\n \"standard_number\" text,\n \"release_date\" text\n);\n\nQuestion: What Type has the Artist of Hiroyuki Takami?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"music\" WHERE \"artist\"='hiroyuki takami';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"music\" (\n \"title\" text,\n \"type\" text,\n \"artist\" text,\n \"label\" text,\n \"standard_number\" text,\n \"release_date\" text\n);\n\nQuestion: What Title has the Label of Columbia and Standard number of CODC-8760?" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"music\" WHERE \"label\"='columbia' AND \"standard_number\"='codc-8760';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"acquisitions_1885_94\" (\n \"name_pinyin\" text,\n \"name_wade_giles\" text,\n \"characters\" text,\n \"type\" text,\n \"construction\" text\n);\n\nQuestion: What is the type of Kuang-Hsing?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"acquisitions_1885_94\" WHERE \"name_wade_giles\"='kuang-hsing';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"acquisitions_1885_94\" (\n \"name_pinyin\" text,\n \"name_wade_giles\" text,\n \"characters\" text,\n \"type\" text,\n \"construction\" text\n);\n\nQuestion: What type has the characters \u5ee3\u4e19?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"acquisitions_1885_94\" WHERE \"characters\"='\u5ee3\u4e19';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"acquisitions_1885_94\" (\n \"name_pinyin\" text,\n \"name_wade_giles\" text,\n \"characters\" text,\n \"type\" text,\n \"construction\" text\n);\n\nQuestion: What's the name that has the characters \u5ee3\u4ea8?" }, { "role": "assistant", "content": "SELECT \"name_wade_giles\" FROM \"acquisitions_1885_94\" WHERE \"characters\"='\u5ee3\u4ea8';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"acquisitions_1885_94\" (\n \"name_pinyin\" text,\n \"name_wade_giles\" text,\n \"characters\" text,\n \"type\" text,\n \"construction\" text\n);\n\nQuestion: What type has the characters \u5ee3\u5229?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"acquisitions_1885_94\" WHERE \"characters\"='\u5ee3\u5229';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"acquisitions_1885_94\" (\n \"name_pinyin\" text,\n \"name_wade_giles\" text,\n \"characters\" text,\n \"type\" text,\n \"construction\" text\n);\n\nQuestion: What is the type of Guangjia?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"acquisitions_1885_94\" WHERE \"name_pinyin\"='guangjia';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_10_across_all_platforms\" (\n \"rank\" real,\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What soap opera has a rank larger than 1, and a Character named Emily Bishop?" }, { "role": "assistant", "content": "SELECT \"soap_opera\" FROM \"top_10_across_all_platforms\" WHERE \"rank\">1 AND \"character\"='emily bishop';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_10_across_all_platforms\" (\n \"rank\" real,\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What is the highest Rank 1960\u2014?" }, { "role": "assistant", "content": "SELECT MAX(\"rank\") FROM \"top_10_across_all_platforms\" WHERE \"years\"='1960\u2014';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_10_across_all_platforms\" (\n \"rank\" real,\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What is the name of the actor with a duration of 61 years?" }, { "role": "assistant", "content": "SELECT \"actor\" FROM \"top_10_across_all_platforms\" WHERE \"duration\"='61 years';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_10_across_all_platforms\" (\n \"rank\" real,\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What are the years for Eileen Derbyshire with a duration of 52 years?" }, { "role": "assistant", "content": "SELECT \"years\" FROM \"top_10_across_all_platforms\" WHERE \"duration\"='52 years' AND \"actor\"='eileen derbyshire';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_10_across_all_platforms\" (\n \"rank\" real,\n \"actor\" text,\n \"character\" text,\n \"soap_opera\" text,\n \"years\" text,\n \"duration\" text\n);\n\nQuestion: What soap opera was on 1960\u20131965, 1965\u20131983, 1984\u20132010?" }, { "role": "assistant", "content": "SELECT \"soap_opera\" FROM \"top_10_across_all_platforms\" WHERE \"years\"='1960\u20131965, 1965\u20131983, 1984\u20132010';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"heat_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: Who are the rowers for Australia?" }, { "role": "assistant", "content": "SELECT \"rowers\" FROM \"heat_1\" WHERE \"country\"='australia';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"heat_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What's Italy's rank?" }, { "role": "assistant", "content": "SELECT SUM(\"rank\") FROM \"heat_1\" WHERE \"country\"='italy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"round\" real,\n \"date\" text,\n \"home\" text,\n \"result\" text,\n \"visitor\" text,\n \"venue\" text,\n \"attendance\" real\n);\n\nQuestion: Who is the visitor team on Saturday, November 22 when link\u00f6pings hc was the home team and there were more than 20 rounds?" }, { "role": "assistant", "content": "SELECT \"visitor\" FROM \"game_log\" WHERE \"home\"='link\u00f6pings hc' AND \"round\">20 AND \"date\"='saturday, november 22';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"round\" real,\n \"date\" text,\n \"home\" text,\n \"result\" text,\n \"visitor\" text,\n \"venue\" text,\n \"attendance\" real\n);\n\nQuestion: What is the lowest attendance on Monday, November 10 when link\u00f6pings hc was the home team and there were more than 18 rounds?" }, { "role": "assistant", "content": "SELECT MIN(\"attendance\") FROM \"game_log\" WHERE \"home\"='link\u00f6pings hc' AND \"date\"='monday, november 10' AND \"round\">18;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"round\" real,\n \"date\" text,\n \"home\" text,\n \"result\" text,\n \"visitor\" text,\n \"venue\" text,\n \"attendance\" real\n);\n\nQuestion: Who is the visitor at the axa sports center in round 20?" }, { "role": "assistant", "content": "SELECT \"visitor\" FROM \"game_log\" WHERE \"venue\"='axa sports center' AND \"round\"=20;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the Attendance of the game on November 6, 1966?" }, { "role": "assistant", "content": "SELECT \"attendance\" FROM \"schedule\" WHERE \"date\"='november 6, 1966';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" text\n);\n\nQuestion: What is the Result of the game on November 6, 1966?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"schedule\" WHERE \"date\"='november 6, 1966';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"women\" (\n \"event\" text,\n \"time\" text,\n \"club\" text,\n \"date\" text,\n \"location\" text\n);\n\nQuestion: Who is the club with a 4:03.63 time?" }, { "role": "assistant", "content": "SELECT \"club\" FROM \"women\" WHERE \"time\"='4:03.63';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"116_seats_needed_for_a_majority\" (\n \"date_released\" text,\n \"institute\" text,\n \"social_democratic\" text,\n \"socialist\" text,\n \"green_communist\" text,\n \"people_s_party\" text,\n \"lead\" text\n);\n\nQuestion: What was the Green-Communist percentage in the poll in which the Socialist Party earned 41.0%?" }, { "role": "assistant", "content": "SELECT \"green_communist\" FROM \"116_seats_needed_for_a_majority\" WHERE \"socialist\"='41.0%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"116_seats_needed_for_a_majority\" (\n \"date_released\" text,\n \"institute\" text,\n \"social_democratic\" text,\n \"socialist\" text,\n \"green_communist\" text,\n \"people_s_party\" text,\n \"lead\" text\n);\n\nQuestion: What is the Green-Communist percentage in the poll showing a 9.7% lead?" }, { "role": "assistant", "content": "SELECT \"green_communist\" FROM \"116_seats_needed_for_a_majority\" WHERE \"lead\"='9.7%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"116_seats_needed_for_a_majority\" (\n \"date_released\" text,\n \"institute\" text,\n \"social_democratic\" text,\n \"socialist\" text,\n \"green_communist\" text,\n \"people_s_party\" text,\n \"lead\" text\n);\n\nQuestion: What is the Social Democratic percentage for the poll with a Green-Communist rate of 9.0%, People's Party of 10.0%, and Socialist of 39.0%?" }, { "role": "assistant", "content": "SELECT \"social_democratic\" FROM \"116_seats_needed_for_a_majority\" WHERE \"green_communist\"='9.0%' AND \"people_s_party\"='10.0%' AND \"socialist\"='39.0%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: what is the result on 9 october 2012?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"international_goals\" WHERE \"date\"='9 october 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: what is the score when the venue is stade g\u00e9n\u00e9ral seyni kountch\u00e9, niamey, the competition is friendly and the date is 9 october 2012?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"international_goals\" WHERE \"venue\"='stade g\u00e9n\u00e9ral seyni kountch\u00e9, niamey' AND \"competition\"='friendly' AND \"date\"='9 october 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: what is the result when the venue is stade g\u00e9n\u00e9ral seyni kountch\u00e9, niamey, the competition is friendly and the date is 9 october 2012?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"international_goals\" WHERE \"venue\"='stade g\u00e9n\u00e9ral seyni kountch\u00e9, niamey' AND \"competition\"='friendly' AND \"date\"='9 october 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: what is the competition on 10 august 2011?" }, { "role": "assistant", "content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"date\"='10 august 2011';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"international_goals\" (\n \"date\" text,\n \"venue\" text,\n \"score\" text,\n \"result\" text,\n \"competition\" text\n);\n\nQuestion: what is the date when the venue is stade g\u00e9n\u00e9ral seyni kountch\u00e9 , niamey?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"international_goals\" WHERE \"venue\"='stade g\u00e9n\u00e9ral seyni kountch\u00e9 , niamey';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_all_time_athletes_50_metres_men\" (\n \"rank\" real,\n \"time\" text,\n \"athlete\" text,\n \"date\" text,\n \"place\" text\n);\n\nQuestion: What place has manfred kokot as the athlete?" }, { "role": "assistant", "content": "SELECT \"place\" FROM \"top_all_time_athletes_50_metres_men\" WHERE \"athlete\"='manfred kokot';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"top_all_time_athletes_50_metres_men\" (\n \"rank\" real,\n \"time\" text,\n \"athlete\" text,\n \"date\" text,\n \"place\" text\n);\n\nQuestion: What athlete has reno as the place?" }, { "role": "assistant", "content": "SELECT \"athlete\" FROM \"top_all_time_athletes_50_metres_men\" WHERE \"place\"='reno';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"campuses\" (\n \"campus\" text,\n \"year_opened\" text,\n \"students\" text,\n \"size\" text,\n \"location\" text\n);\n\nQuestion: What campus opened in 1970?" }, { "role": "assistant", "content": "SELECT \"campus\" FROM \"campuses\" WHERE \"year_opened\"='1970';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"campuses\" (\n \"campus\" text,\n \"year_opened\" text,\n \"students\" text,\n \"size\" text,\n \"location\" text\n);\n\nQuestion: What year was the school opened that has a size of 10 acres and students of na?" }, { "role": "assistant", "content": "SELECT \"year_opened\" FROM \"campuses\" WHERE \"students\"='na' AND \"size\"='10 acres';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"campuses\" (\n \"campus\" text,\n \"year_opened\" text,\n \"students\" text,\n \"size\" text,\n \"location\" text\n);\n\nQuestion: What location was the campus that has a size of 245 acres?" }, { "role": "assistant", "content": "SELECT \"location\" FROM \"campuses\" WHERE \"size\"='245 acres';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"campuses\" (\n \"campus\" text,\n \"year_opened\" text,\n \"students\" text,\n \"size\" text,\n \"location\" text\n);\n\nQuestion: What campus was opened in 1977?" }, { "role": "assistant", "content": "SELECT \"campus\" FROM \"campuses\" WHERE \"year_opened\"='1977';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"campuses\" (\n \"campus\" text,\n \"year_opened\" text,\n \"students\" text,\n \"size\" text,\n \"location\" text\n);\n\nQuestion: What location was the campus opened in 2005 with students listed as na?" }, { "role": "assistant", "content": "SELECT \"location\" FROM \"campuses\" WHERE \"students\"='na' AND \"year_opened\"='2005';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"largest_generating_stations\" (\n \"rank\" real,\n \"name\" text,\n \"capacity_mw\" real,\n \"province\" text,\n \"type\" text\n);\n\nQuestion: what is the type when the rank is smaller than 70, the province is british columbia and the capacity (mw) is more than 2,480?" }, { "role": "assistant", "content": "SELECT \"type\" FROM \"largest_generating_stations\" WHERE \"rank\"<70 AND \"province\"='british columbia' AND \"capacity_mw\">'2,480';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"largest_generating_stations\" (\n \"rank\" real,\n \"name\" text,\n \"capacity_mw\" real,\n \"province\" text,\n \"type\" text\n);\n\nQuestion: what is the least capacity (mw) when the rank is less than 46 and the province is newfoundland and labrador?" }, { "role": "assistant", "content": "SELECT MIN(\"capacity_mw\") FROM \"largest_generating_stations\" WHERE \"rank\"<46 AND \"province\"='newfoundland and labrador';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"largest_generating_stations\" (\n \"rank\" real,\n \"name\" text,\n \"capacity_mw\" real,\n \"province\" text,\n \"type\" text\n);\n\nQuestion: what is the lowest rank when the type is hydro, the name is grand rapids generating station and the capacity (mw) is more than 479?" }, { "role": "assistant", "content": "SELECT MIN(\"rank\") FROM \"largest_generating_stations\" WHERE \"type\"='hydro' AND \"name\"='grand rapids generating station' AND \"capacity_mw\">479;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"largest_generating_stations\" (\n \"rank\" real,\n \"name\" text,\n \"capacity_mw\" real,\n \"province\" text,\n \"type\" text\n);\n\nQuestion: what is the province when the rank is higher than 24 and the name is laforge-2?" }, { "role": "assistant", "content": "SELECT \"province\" FROM \"largest_generating_stations\" WHERE \"rank\">24 AND \"name\"='laforge-2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"largest_generating_stations\" (\n \"rank\" real,\n \"name\" text,\n \"capacity_mw\" real,\n \"province\" text,\n \"type\" text\n);\n\nQuestion: what is the name when the type is hydro, the capacity (mw) is less than 478, the rank is more than 85 and the province is quebec?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"largest_generating_stations\" WHERE \"type\"='hydro' AND \"capacity_mw\"<478 AND \"rank\">85 AND \"province\"='quebec';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"complete_24_hours_of_le_mans_results\" (\n \"year\" real,\n \"class\" text,\n \"tyres\" text,\n \"team\" text,\n \"co_drivers\" text,\n \"laps\" real,\n \"pos\" text\n);\n\nQuestion: How many years have toyota team tom's as the team, with Laps greater than 64?" }, { "role": "assistant", "content": "SELECT COUNT(\"year\") FROM \"complete_24_hours_of_le_mans_results\" WHERE \"team\"='toyota team tom''s' AND \"laps\">64;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"anglo_italian_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: What round was on 11/11/1992?" }, { "role": "assistant", "content": "SELECT \"round\" FROM \"anglo_italian_cup\" WHERE \"date\"='11/11/1992';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"anglo_italian_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: What is the total against on 08/12/1992?" }, { "role": "assistant", "content": "SELECT SUM(\"against\") FROM \"anglo_italian_cup\" WHERE \"date\"='08/12/1992';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"anglo_italian_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: What is the venue of 24/11/1992?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"anglo_italian_cup\" WHERE \"date\"='24/11/1992';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"anglo_italian_cup\" (\n \"opposing_team\" text,\n \"against\" real,\n \"date\" text,\n \"venue\" text,\n \"round\" text\n);\n\nQuestion: What round has less than 1 against?" }, { "role": "assistant", "content": "SELECT \"round\" FROM \"anglo_italian_cup\" WHERE \"against\"<1;" } ]
[ { "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 gold medals for germany (GER) having a rank less than 15?" }, { "role": "assistant", "content": "SELECT COUNT(\"gold\") FROM \"medal_table\" WHERE \"nation\"='germany (ger)' AND \"rank\"<15;" } ]
[ { "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 silver medals when the bronze is more than 2 and having a rank more than 5?" }, { "role": "assistant", "content": "SELECT MAX(\"silver\") FROM \"medal_table\" WHERE \"rank\">5 AND \"bronze\">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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the average number of silver medals when bronze is less than 0?" }, { "role": "assistant", "content": "SELECT AVG(\"silver\") FROM \"medal_table\" WHERE \"bronze\"<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\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What's the average number of silver medals for germany (GER) having more than 3 bronze?" }, { "role": "assistant", "content": "SELECT AVG(\"silver\") FROM \"medal_table\" WHERE \"nation\"='germany (ger)' AND \"bronze\">3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_a_b_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What are the notes for 6:31.16?" }, { "role": "assistant", "content": "SELECT \"notes\" FROM \"semifinal_a_b_1\" WHERE \"time\"='6:31.16';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_a_b_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What rowers have a 6:29.56 time?" }, { "role": "assistant", "content": "SELECT \"rowers\" FROM \"semifinal_a_b_1\" WHERE \"time\"='6:29.56';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_a_b_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What is the time with FB notes for Canada?" }, { "role": "assistant", "content": "SELECT \"time\" FROM \"semifinal_a_b_1\" WHERE \"notes\"='fb' AND \"country\"='canada';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_a_b_1\" (\n \"rank\" real,\n \"rowers\" text,\n \"country\" text,\n \"time\" text,\n \"notes\" text\n);\n\nQuestion: What country has a time of 6:49.28?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"semifinal_a_b_1\" WHERE \"time\"='6:49.28';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pool_3\" (\n \"team\" text,\n \"tries_for\" real,\n \"tries_against\" real,\n \"try_diff\" text,\n \"points_for\" real,\n \"points_against\" real,\n \"points_diff\" text\n);\n\nQuestion: Which Tries for has Points against larger than 87, and Tries against smaller than 28, and Points diff of +63?" }, { "role": "assistant", "content": "SELECT AVG(\"tries_for\") FROM \"pool_3\" WHERE \"points_against\">87 AND \"tries_against\"<28 AND \"points_diff\"='+63';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pool_3\" (\n \"team\" text,\n \"tries_for\" real,\n \"tries_against\" real,\n \"try_diff\" text,\n \"points_for\" real,\n \"points_against\" real,\n \"points_diff\" text\n);\n\nQuestion: Which Points for has Points against smaller than 93, and Tries for larger than 25?" }, { "role": "assistant", "content": "SELECT MIN(\"points_for\") FROM \"pool_3\" WHERE \"points_against\"<93 AND \"tries_for\">25;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pool_3\" (\n \"team\" text,\n \"tries_for\" real,\n \"tries_against\" real,\n \"try_diff\" text,\n \"points_for\" real,\n \"points_against\" real,\n \"points_diff\" text\n);\n\nQuestion: Which Tries for has Points against smaller than 124, and Points for smaller than 241, and Tries against smaller than 11?" }, { "role": "assistant", "content": "SELECT MAX(\"tries_for\") FROM \"pool_3\" WHERE \"points_against\"<124 AND \"points_for\"<241 AND \"tries_against\"<11;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"pool_3\" (\n \"team\" text,\n \"tries_for\" real,\n \"tries_against\" real,\n \"try_diff\" text,\n \"points_for\" real,\n \"points_against\" real,\n \"points_diff\" text\n);\n\nQuestion: How many Tries against have a Team of dinamo bucure\u015fti, and Tries for smaller than 19?" }, { "role": "assistant", "content": "SELECT COUNT(\"tries_against\") FROM \"pool_3\" WHERE \"team\"='dinamo bucure\u015fti' AND \"tries_for\"<19;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What week had attendance of 48,667?" }, { "role": "assistant", "content": "SELECT COUNT(\"week\") FROM \"schedule\" WHERE \"attendance\"='48,667';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results_of_heat_1\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"percentage\" text,\n \"place\" real\n);\n\nQuestion: What Song has a Draw of less than 4 with a Percentage of 32.22%?" }, { "role": "assistant", "content": "SELECT \"song\" FROM \"results_of_heat_1\" WHERE \"draw\"<4 AND \"percentage\"='32.22%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results_of_heat_1\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"percentage\" text,\n \"place\" real\n);\n\nQuestion: What Artist has a Place of 3 or less with a Percentage of 38.60%?" }, { "role": "assistant", "content": "SELECT \"artist\" FROM \"results_of_heat_1\" WHERE \"place\"<3 AND \"percentage\"='38.60%';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"results_of_heat_1\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"percentage\" text,\n \"place\" real\n);\n\nQuestion: What is the Place of Draw 1 by Artist Monika Kirovska?" }, { "role": "assistant", "content": "SELECT AVG(\"place\") FROM \"results_of_heat_1\" WHERE \"artist\"='monika kirovska' AND \"draw\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What were the most byes of Terang-Mortlake when they had more than 11 wins and more than 1118 against?" }, { "role": "assistant", "content": "SELECT MAX(\"byes\") FROM \"2009_ladder\" WHERE \"wins\">11 AND \"against\">1118 AND \"hampden_fl\"='terang-mortlake';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: How many wins did South Warrambool have?" }, { "role": "assistant", "content": "SELECT AVG(\"wins\") FROM \"2009_ladder\" WHERE \"hampden_fl\"='south warrambool';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: How many byes when there are more than 16 wins?" }, { "role": "assistant", "content": "SELECT AVG(\"byes\") FROM \"2009_ladder\" WHERE \"wins\">16;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the least amount of Byes when there are more than 2 wins and 1946 against?" }, { "role": "assistant", "content": "SELECT MIN(\"byes\") FROM \"2009_ladder\" WHERE \"against\"=1946 AND \"wins\">2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2009_ladder\" (\n \"hampden_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: How many wins when the draws are less than 1 and more than 4 losses?" }, { "role": "assistant", "content": "SELECT AVG(\"wins\") FROM \"2009_ladder\" WHERE \"draws\"<1 AND \"losses\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"s\" (\n \"township\" text,\n \"county\" text,\n \"pop_2010\" real,\n \"land_sqmi\" real,\n \"water_sqmi\" real,\n \"latitude\" real,\n \"longitude\" real,\n \"geo_id\" real,\n \"ansi_code\" real\n);\n\nQuestion: What was the lowest population of the GEO ID 3805373380 and the water square mileage smaller than 5.729?" }, { "role": "assistant", "content": "SELECT MIN(\"pop_2010\") FROM \"s\" WHERE \"geo_id\"=3805373380 AND \"water_sqmi\"<5.729;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"s\" (\n \"township\" text,\n \"county\" text,\n \"pop_2010\" real,\n \"land_sqmi\" real,\n \"water_sqmi\" real,\n \"latitude\" real,\n \"longitude\" real,\n \"geo_id\" real,\n \"ansi_code\" real\n);\n\nQuestion: What is the lowest GEO ID for the longitude of -102.158045 and the water in square miles larger than 0.979?" }, { "role": "assistant", "content": "SELECT MIN(\"geo_id\") FROM \"s\" WHERE \"longitude\"=-102.158045 AND \"water_sqmi\">0.979;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"s\" (\n \"township\" text,\n \"county\" text,\n \"pop_2010\" real,\n \"land_sqmi\" real,\n \"water_sqmi\" real,\n \"latitude\" real,\n \"longitude\" real,\n \"geo_id\" real,\n \"ansi_code\" real\n);\n\nQuestion: What is the average ANSI code for the town of Sherman and the smaller of the water area in square miles than 0.005?" }, { "role": "assistant", "content": "SELECT AVG(\"ansi_code\") FROM \"s\" WHERE \"township\"='sherman' AND \"water_sqmi\"<0.005;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"s\" (\n \"township\" text,\n \"county\" text,\n \"pop_2010\" real,\n \"land_sqmi\" real,\n \"water_sqmi\" real,\n \"latitude\" real,\n \"longitude\" real,\n \"geo_id\" real,\n \"ansi_code\" real\n);\n\nQuestion: What is the average longitude for the water area of 0.093 and has a GEO ID tag larger than 3808174460?" }, { "role": "assistant", "content": "SELECT AVG(\"longitude\") FROM \"s\" WHERE \"water_sqmi\"=0.093 AND \"geo_id\">3808174460;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"play\" text,\n \"author\" text,\n \"company\" text,\n \"base\" text,\n \"country\" text\n);\n\nQuestion: Which Country's Author is based on Sophocles and Euripides?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"references\" WHERE \"author\"='based on sophocles and euripides';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"play\" text,\n \"author\" text,\n \"company\" text,\n \"base\" text,\n \"country\" text\n);\n\nQuestion: Which Author's Company is Ruth Kanner Theatre Group?" }, { "role": "assistant", "content": "SELECT \"author\" FROM \"references\" WHERE \"company\"='ruth kanner theatre group';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"play\" text,\n \"author\" text,\n \"company\" text,\n \"base\" text,\n \"country\" text\n);\n\nQuestion: Which Play is from Cyprus, from the Company Magdalena Zira Theatre?" }, { "role": "assistant", "content": "SELECT \"play\" FROM \"references\" WHERE \"country\"='cyprus' AND \"company\"='magdalena zira theatre';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"play\" text,\n \"author\" text,\n \"company\" text,\n \"base\" text,\n \"country\" text\n);\n\nQuestion: Which Country is the Play Electra and Orestes, The Trial from?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"references\" WHERE \"play\"='electra and orestes, the trial';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_3\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: How much total time was in lane 4?" }, { "role": "assistant", "content": "SELECT COUNT(\"time\") FROM \"semifinal_3\" WHERE \"lane\"=4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_3\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: Which Rank has a Reaction time larger than 0.20400000000000001, and a Time larger than 45.56?" }, { "role": "assistant", "content": "SELECT MAX(\"rank\") FROM \"semifinal_3\" WHERE \"react\">0.20400000000000001 AND \"time\">45.56;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_3\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: How many ranks have more than 7 lanes, and an Athlete of michael mathieu, and a Reaction time larger than 0.203?" }, { "role": "assistant", "content": "SELECT SUM(\"rank\") FROM \"semifinal_3\" WHERE \"lane\">7 AND \"athlete\"='michael mathieu' AND \"react\">0.203;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"semifinal_3\" (\n \"rank\" real,\n \"lane\" real,\n \"athlete\" text,\n \"nationality\" text,\n \"time\" real,\n \"react\" real\n);\n\nQuestion: Which Time has a Reaction smaller than 0.20400000000000001, and a Rank of 1?" }, { "role": "assistant", "content": "SELECT SUM(\"time\") FROM \"semifinal_3\" WHERE \"react\"<0.20400000000000001 AND \"rank\"=1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What's the average Top-25, that has an Events that's smaller than 12, and has a Top-5 that is larger than 0?" }, { "role": "assistant", "content": "SELECT AVG(\"top_25\") FROM \"summary\" WHERE \"events\"<12 AND \"top_5\">0;" } ]