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 \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Tell me the average Laps for grid larger than 22" }, { "role": "assistant", "content": "SELECT AVG(\"laps\") FROM \"race\" WHERE \"grid\">22;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Tell me the constructor for grid of 17" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"race\" WHERE \"grid\"=17;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"ukraine_managers\" (\n \"manager\" text,\n \"ukraine_career\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"win_pct\" real\n);\n\nQuestion: What years had a manager who lost more than 1 and drawn more than 11?" }, { "role": "assistant", "content": "SELECT \"ukraine_career\" FROM \"ukraine_managers\" WHERE \"lost\">1 AND \"drawn\">11;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"ukraine_managers\" (\n \"manager\" text,\n \"ukraine_career\" text,\n \"played\" real,\n \"drawn\" real,\n \"lost\" real,\n \"win_pct\" real\n);\n\nQuestion: what is the total win % of manager viktor prokopenko, when he lost fewer than 2?" }, { "role": "assistant", "content": "SELECT COUNT(\"win_pct\") FROM \"ukraine_managers\" WHERE \"manager\"='viktor prokopenko' AND \"lost\"<2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"format_and_schedule\" (\n \"round\" text,\n \"date_s\" text,\n \"clubs_from_the_previous_round\" text,\n \"clubs_involved\" real,\n \"fixtures\" real\n);\n\nQuestion: When 4 clubs are involved, what is the average number of fixtures?" }, { "role": "assistant", "content": "SELECT AVG(\"fixtures\") FROM \"format_and_schedule\" WHERE \"clubs_involved\"=4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"format_and_schedule\" (\n \"round\" text,\n \"date_s\" text,\n \"clubs_from_the_previous_round\" text,\n \"clubs_involved\" real,\n \"fixtures\" real\n);\n\nQuestion: In the sixth round, what is the sum of fixtures when there were more than 15 clubs involved?" }, { "role": "assistant", "content": "SELECT SUM(\"fixtures\") FROM \"format_and_schedule\" WHERE \"round\"='sixth round' AND \"clubs_involved\">15;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"year_by_year\" (\n \"year\" text,\n \"division\" text,\n \"league\" text,\n \"reg_season\" text,\n \"playoffs\" text,\n \"challenge_cup\" text\n);\n\nQuestion: Tell me the league for year of 1915/16" }, { "role": "assistant", "content": "SELECT \"league\" FROM \"year_by_year\" WHERE \"year\"='1915/16';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the make of the car that drove 54 laps?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"race\" WHERE \"laps\"=54;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"highest_capped\" (\n \"name\" text,\n \"career\" text,\n \"caps\" real,\n \"goals\" real,\n \"first_cap\" text,\n \"recent_cap\" text\n);\n\nQuestion: Who has a 59 cap?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"highest_capped\" WHERE \"caps\"=59;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"translators\" (\n \"call_sign\" text,\n \"frequency_m_hz\" real,\n \"city_of_license\" text,\n \"erp_w\" real,\n \"class\" text,\n \"fcc_info\" text\n);\n\nQuestion: Tell me the sum of frequency for ERP W less than 1" }, { "role": "assistant", "content": "SELECT SUM(\"frequency_m_hz\") FROM \"translators\" WHERE \"erp_w\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"players\" (\n \"player\" text,\n \"total_w_l\" text,\n \"singles_w_l\" text,\n \"doubles_w_l\" text,\n \"ties_played\" real,\n \"debut\" real,\n \"years_played\" real\n);\n\nQuestion: Tell me the lowest ties played with a debut of 1936" }, { "role": "assistant", "content": "SELECT MIN(\"ties_played\") FROM \"players\" WHERE \"debut\"=1936;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: Where did the Paris Marathon occur?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"achievements\" WHERE \"competition\"='paris marathon';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"current_usl_soccer_specific_stadiums\" (\n \"stadium\" text,\n \"club_s\" text,\n \"division\" text,\n \"city\" text,\n \"capacity\" real,\n \"opened\" text\n);\n\nQuestion: Tell me the capacity for city park stadium" }, { "role": "assistant", "content": "SELECT \"capacity\" FROM \"current_usl_soccer_specific_stadiums\" WHERE \"stadium\"='city park stadium';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"titles_6\" (\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: Tell me the tournament for opponents of andrei pavel rogier wassen" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"titles_6\" WHERE \"opponents_in_the_final\"='andrei pavel rogier wassen';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"titles_6\" (\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: Tell me the tournament for score in the final of 1\u20136, 3\u20136" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"titles_6\" WHERE \"score_in_the_final\"='1\u20136, 3\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"titles_6\" (\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: Tell me the opponents for score in the final of 1\u20136, 2\u20136" }, { "role": "assistant", "content": "SELECT \"opponents_in_the_final\" FROM \"titles_6\" WHERE \"score_in_the_final\"='1\u20136, 2\u20136';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"titles_6\" (\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: Tell me the surface for 16 april 2007" }, { "role": "assistant", "content": "SELECT \"surface\" FROM \"titles_6\" WHERE \"date\"='16 april 2007';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"publications\" (\n \"title\" text,\n \"year\" real,\n \"isbn\" text,\n \"volume\" text,\n \"strips\" text,\n \"pages\" real,\n \"colors\" text\n);\n\nQuestion: I want the average pages for ISBN of 978-0-9766580-5-4" }, { "role": "assistant", "content": "SELECT AVG(\"pages\") FROM \"publications\" WHERE \"isbn\"='978-0-9766580-5-4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"publications\" (\n \"title\" text,\n \"year\" real,\n \"isbn\" text,\n \"volume\" text,\n \"strips\" text,\n \"pages\" real,\n \"colors\" text\n);\n\nQuestion: Tell me the sum of year for 244 pages" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"publications\" WHERE \"pages\"=244;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"publications\" (\n \"title\" text,\n \"year\" real,\n \"isbn\" text,\n \"volume\" text,\n \"strips\" text,\n \"pages\" real,\n \"colors\" text\n);\n\nQuestion: Tell me the title for pages of 96" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"publications\" WHERE \"pages\"=96;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"historical\" (\n \"begin_date\" text,\n \"representative\" text,\n \"date_of_birth\" text,\n \"house_term\" text,\n \"state_served\" text,\n \"party\" text,\n \"age_years_days\" text\n);\n\nQuestion: What was the date of birth of a republican member of the United States House of Representatives who held the term of 1863-1865?" }, { "role": "assistant", "content": "SELECT \"date_of_birth\" FROM \"historical\" WHERE \"party\"='republican' AND \"house_term\"='1863-1865';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"historical\" (\n \"begin_date\" text,\n \"representative\" text,\n \"date_of_birth\" text,\n \"house_term\" text,\n \"state_served\" text,\n \"party\" text,\n \"age_years_days\" text\n);\n\nQuestion: What was the age of the member of the United States House of Representatives that began their term on May 7, 1886?" }, { "role": "assistant", "content": "SELECT \"age_years_days\" FROM \"historical\" WHERE \"begin_date\"='may 7, 1886';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"historical\" (\n \"begin_date\" text,\n \"representative\" text,\n \"date_of_birth\" text,\n \"house_term\" text,\n \"state_served\" text,\n \"party\" text,\n \"age_years_days\" text\n);\n\nQuestion: What was the date of birth of the member of the United States House of Representatives that began their term on April 24, 1902?" }, { "role": "assistant", "content": "SELECT \"date_of_birth\" FROM \"historical\" WHERE \"begin_date\"='april 24, 1902';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"historical\" (\n \"begin_date\" text,\n \"representative\" text,\n \"date_of_birth\" text,\n \"house_term\" text,\n \"state_served\" text,\n \"party\" text,\n \"age_years_days\" text\n);\n\nQuestion: Which member of the United States House of Representatives began their term on January 4, 1997?" }, { "role": "assistant", "content": "SELECT \"representative\" FROM \"historical\" WHERE \"begin_date\"='january 4, 1997';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"historical\" (\n \"begin_date\" text,\n \"representative\" text,\n \"date_of_birth\" text,\n \"house_term\" text,\n \"state_served\" text,\n \"party\" text,\n \"age_years_days\" text\n);\n\nQuestion: Which state did Samuel Thatcher of the Federalist party represent?" }, { "role": "assistant", "content": "SELECT \"state_served\" FROM \"historical\" WHERE \"party\"='federalist' AND \"representative\"='samuel thatcher';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"t\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_in_toronto\" text,\n \"school_club_team\" text\n);\n\nQuestion: What position does Hedo T\u00fcrko\u011flu play?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"t\" WHERE \"player\"='hedo t\u00fcrko\u011flu';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"t\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_in_toronto\" text,\n \"school_club_team\" text\n);\n\nQuestion: How long has Sebastian Telfair played for Toronto?" }, { "role": "assistant", "content": "SELECT \"years_in_toronto\" FROM \"t\" WHERE \"player\"='sebastian telfair';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"games_developed\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the title for japan august 23, 2012" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"games_developed\" WHERE \"japan\"='august 23, 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"games_developed\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the title for japan august 23, 2012" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"games_developed\" WHERE \"japan\"='august 23, 2012';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"games_developed\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the Australia march 17, 2005" }, { "role": "assistant", "content": "SELECT \"australia\" FROM \"games_developed\" WHERE \"japan\"='march 17, 2005';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"games_developed\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the Europe for z.h.p. unlosing ranger vs darkdeath evilman" }, { "role": "assistant", "content": "SELECT \"europe\" FROM \"games_developed\" WHERE \"title\"='z.h.p. unlosing ranger vs darkdeath evilman';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"group_a\" (\n \"place\" real,\n \"team\" text,\n \"wins\" real,\n \"ties\" real,\n \"losses\" real,\n \"points\" text\n);\n\nQuestion: Name the total losses for 4 place and ties less than 0" }, { "role": "assistant", "content": "SELECT COUNT(\"losses\") FROM \"group_a\" WHERE \"place\"=4 AND \"ties\"<0;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"group_a\" (\n \"place\" real,\n \"team\" text,\n \"wins\" real,\n \"ties\" real,\n \"losses\" real,\n \"points\" text\n);\n\nQuestion: Name the average place for ties less than 1 and losess more than 3 with points of 6 qc" }, { "role": "assistant", "content": "SELECT AVG(\"place\") FROM \"group_a\" WHERE \"ties\"<1 AND \"points\"='6 qc' AND \"losses\">3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"group_a\" (\n \"place\" real,\n \"team\" text,\n \"wins\" real,\n \"ties\" real,\n \"losses\" real,\n \"points\" text\n);\n\nQuestion: Name the most wins for losses more than 2 and points of two with place larger than 7" }, { "role": "assistant", "content": "SELECT MAX(\"wins\") FROM \"group_a\" WHERE \"losses\">2 AND \"points\"='2' AND \"place\">7;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"group_a\" (\n \"place\" real,\n \"team\" text,\n \"wins\" real,\n \"ties\" real,\n \"losses\" real,\n \"points\" text\n);\n\nQuestion: Name the sum of place with ties larger than 0 and point sof 7 qc and losses more than 2" }, { "role": "assistant", "content": "SELECT SUM(\"place\") FROM \"group_a\" WHERE \"ties\">0 AND \"points\"='7 qc' AND \"losses\">2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"fleet_details\" (\n \"class\" text,\n \"type\" text,\n \"no_converted\" real,\n \"year_converted\" text,\n \"no_range\" text,\n \"operator\" text,\n \"withdrawn\" text\n);\n\nQuestion: Tell me the number range for 4vip" }, { "role": "assistant", "content": "SELECT \"no_range\" FROM \"fleet_details\" WHERE \"type\"='4vip';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat_rank\" real,\n \"lane\" real,\n \"swimmer\" text,\n \"country\" text,\n \"time\" real,\n \"overall_rank\" text\n);\n\nQuestion: Name the heat rank for senegal" }, { "role": "assistant", "content": "SELECT \"heat_rank\" FROM \"heats\" WHERE \"country\"='senegal';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the value for 2010 when the 2012 value is Q2?" }, { "role": "assistant", "content": "SELECT \"2010\" FROM \"singles_performance_timeline\" WHERE \"2012\"='q2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the value for 2010 when the value for 2006 is A and the value for 2009 is 1R?" }, { "role": "assistant", "content": "SELECT \"2010\" FROM \"singles_performance_timeline\" WHERE \"2006\"='a' AND \"2009\"='1r';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the value for 2012 when the value for 2009 is 1R and the vale for 2007 is 2R?" }, { "role": "assistant", "content": "SELECT \"2012\" FROM \"singles_performance_timeline\" WHERE \"2009\"='1r' AND \"2007\"='2r';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the value for 2008 for the US Open Tournament?" }, { "role": "assistant", "content": "SELECT \"2008\" FROM \"singles_performance_timeline\" WHERE \"tournament\"='us open';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_performance_timeline\" (\n \"tournament\" text,\n \"2006\" text,\n \"2007\" text,\n \"2008\" text,\n \"2009\" text,\n \"2010\" text,\n \"2011\" text,\n \"2012\" text\n);\n\nQuestion: What is the value for 2009 when the value for 2011 is 138?" }, { "role": "assistant", "content": "SELECT \"2009\" FROM \"singles_performance_timeline\" WHERE \"2011\"='138';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"season_4_1976_1977\" (\n \"series_num\" real,\n \"season_num\" real,\n \"title\" text,\n \"original_air_date\" text,\n \"tape_date\" text\n);\n\nQuestion: Tell me the highest series # for september 22, 1976" }, { "role": "assistant", "content": "SELECT MAX(\"series_num\") FROM \"season_4_1976_1977\" WHERE \"original_air_date\"='september 22, 1976';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"performance_series\" (\n \"model\" text,\n \"release_date\" text,\n \"sensor_res_size\" text,\n \"lens_35mmequiv_zoom_aperture\" text,\n \"screen_size_pixels\" text,\n \"dimensions_w_h_d_mm\" text,\n \"weight\" text\n);\n\nQuestion: What is the screen size and pixel value when the lens aperture is 26\u2013678mm (26\u00d7) f /2.8\u20135?" }, { "role": "assistant", "content": "SELECT \"screen_size_pixels\" FROM \"performance_series\" WHERE \"lens_35mmequiv_zoom_aperture\"='26\u2013678mm (26\u00d7) f /2.8\u20135';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"performance_series\" (\n \"model\" text,\n \"release_date\" text,\n \"sensor_res_size\" text,\n \"lens_35mmequiv_zoom_aperture\" text,\n \"screen_size_pixels\" text,\n \"dimensions_w_h_d_mm\" text,\n \"weight\" text\n);\n\nQuestion: What is the screen size and pixel value when the dimensions are 115.5\u00d783.7\u00d7102.5?" }, { "role": "assistant", "content": "SELECT \"screen_size_pixels\" FROM \"performance_series\" WHERE \"dimensions_w_h_d_mm\"='115.5\u00d783.7\u00d7102.5';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"performance_series\" (\n \"model\" text,\n \"release_date\" text,\n \"sensor_res_size\" text,\n \"lens_35mmequiv_zoom_aperture\" text,\n \"screen_size_pixels\" text,\n \"dimensions_w_h_d_mm\" text,\n \"weight\" text\n);\n\nQuestion: What is the screen size and pixel amount of model p5000 when the dimensions are 98\u00d764.5\u00d741?" }, { "role": "assistant", "content": "SELECT \"screen_size_pixels\" FROM \"performance_series\" WHERE \"dimensions_w_h_d_mm\"='98\u00d764.5\u00d741' AND \"model\"='p5000';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"number_of_children_involved_in_ilo_categ\" (\n \"all_children_000s\" real,\n \"economically_active_children_000s\" real,\n \"economically_active_children_pct\" real,\n \"child_labour_000s\" real,\n \"child_labour_pct\" real,\n \"children_in_hazardous_work_000s\" real,\n \"children_in_hazardous_work_pct\" real\n);\n\nQuestion: What is the lowest number for all children when the child labour percentage is greater than 15.5 and the number of children in hazardous work is 170,500 while the number of economically active children is more than 351,700?" }, { "role": "assistant", "content": "SELECT MIN(\"all_children_000s\") FROM \"number_of_children_involved_in_ilo_categ\" WHERE \"child_labour_pct\">15.5 AND \"children_in_hazardous_work_000s\"='170,500' AND \"economically_active_children_000s\">'351,700';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"number_of_children_involved_in_ilo_categ\" (\n \"all_children_000s\" real,\n \"economically_active_children_000s\" real,\n \"economically_active_children_pct\" real,\n \"child_labour_000s\" real,\n \"child_labour_pct\" real,\n \"children_in_hazardous_work_000s\" real,\n \"children_in_hazardous_work_pct\" real\n);\n\nQuestion: What is the lowest total number of children when there are more than 15.2% in child labour, less than 23.4% economically active, and the number economically active is 210,800?" }, { "role": "assistant", "content": "SELECT MIN(\"all_children_000s\") FROM \"number_of_children_involved_in_ilo_categ\" WHERE \"child_labour_pct\">15.2 AND \"economically_active_children_pct\"<23.4 AND \"economically_active_children_000s\"='210,800';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"record_by_conference\" (\n \"conference\" text,\n \"num_of_bids\" real,\n \"record\" text,\n \"win_pct\" text,\n \"round_of_32\" text,\n \"elite_eight\" text,\n \"final_four\" text,\n \"championship_game\" text\n);\n\nQuestion: Tell me the championship game for big eight" }, { "role": "assistant", "content": "SELECT \"championship_game\" FROM \"record_by_conference\" WHERE \"conference\"='big eight';" } ]
[ { "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 lowest total for rank of 13 with bronze less than 1" }, { "role": "assistant", "content": "SELECT MIN(\"total\") FROM \"medal_table\" WHERE \"rank\"=13 AND \"bronze\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"original_week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"venue\" text\n);\n\nQuestion: Tell me the sum of original week for september 16, 1982" }, { "role": "assistant", "content": "SELECT SUM(\"original_week\") FROM \"schedule\" WHERE \"date\"='september 16, 1982';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"original_week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"venue\" text\n);\n\nQuestion: Tell me the average original week for soldier field" }, { "role": "assistant", "content": "SELECT AVG(\"original_week\") FROM \"schedule\" WHERE \"venue\"='soldier field';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"original_week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"venue\" text\n);\n\nQuestion: Tell me the date for original week less than 16 and result of l 23\u201322" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"schedule\" WHERE \"original_week\"<16 AND \"result\"='l 23\u201322';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"fm_stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"owner\" text,\n \"format\" text\n);\n\nQuestion: Tell me the call sign for frequency of 0 97.3 fm" }, { "role": "assistant", "content": "SELECT \"call_sign\" FROM \"fm_stations\" WHERE \"frequency\"='0 97.3 fm';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"fm_stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"owner\" text,\n \"format\" text\n);\n\nQuestion: Tell me the owner for classical" }, { "role": "assistant", "content": "SELECT \"owner\" FROM \"fm_stations\" WHERE \"format\"='classical';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"fm_stations\" (\n \"call_sign\" text,\n \"frequency\" text,\n \"city_of_license\" text,\n \"owner\" text,\n \"format\" text\n);\n\nQuestion: Tell me the city of license for 0 106.9 fm" }, { "role": "assistant", "content": "SELECT \"city_of_license\" FROM \"fm_stations\" WHERE \"frequency\"='0 106.9 fm';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"o\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_in_toronto\" text,\n \"school_club_team\" text\n);\n\nQuestion: What year(s) did Hakeem Olajuwon play Center for Toronto?" }, { "role": "assistant", "content": "SELECT \"years_in_toronto\" FROM \"o\" WHERE \"player\"='hakeem olajuwon';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"o\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_in_toronto\" text,\n \"school_club_team\" text\n);\n\nQuestion: What position did Jimmy Oliver of the United States play?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"o\" WHERE \"nationality\"='united states' AND \"player\"='jimmy oliver';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"name\" text,\n \"canton\" text,\n \"height_meters\" real,\n \"crest_length_meters\" real,\n \"type\" text,\n \"year_of_construction\" real,\n \"name_of_the_lake\" text\n);\n\nQuestion: Tell me the total number of crest length for year construction larger than 1957 for mattmark" }, { "role": "assistant", "content": "SELECT COUNT(\"crest_length_meters\") FROM \"see_also\" WHERE \"year_of_construction\">1957 AND \"name\"='mattmark';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"name\" text,\n \"canton\" text,\n \"height_meters\" real,\n \"crest_length_meters\" real,\n \"type\" text,\n \"year_of_construction\" real,\n \"name_of_the_lake\" text\n);\n\nQuestion: Tell me the name of lake for crest length of 430" }, { "role": "assistant", "content": "SELECT \"name_of_the_lake\" FROM \"see_also\" WHERE \"crest_length_meters\"=430;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"ternary_azeotropes\" (\n \"2nd_component\" text,\n \"b_p_2nd_comp_c\" real,\n \"3rd_component\" text,\n \"b_p_3rd_comp_c\" text,\n \"b_p_azeo_c\" text,\n \"pct_wt_1st\" text,\n \"pct_wt_2nd\" text,\n \"pct_wt_3rd\" text\n);\n\nQuestion: Tell me the % of wt 2nd for bp 3rd comp of 98.4" }, { "role": "assistant", "content": "SELECT \"pct_wt_2nd\" FROM \"ternary_azeotropes\" WHERE \"b_p_3rd_comp_c\"='98.4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"ternary_azeotropes\" (\n \"2nd_component\" text,\n \"b_p_2nd_comp_c\" real,\n \"3rd_component\" text,\n \"b_p_3rd_comp_c\" text,\n \"b_p_azeo_c\" text,\n \"pct_wt_1st\" text,\n \"pct_wt_2nd\" text,\n \"pct_wt_3rd\" text\n);\n\nQuestion: Tell me the 3rd component for bp azeo of 62.1" }, { "role": "assistant", "content": "SELECT \"3rd_component\" FROM \"ternary_azeotropes\" WHERE \"b_p_azeo_c\"='62.1';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"rank\" real,\n \"county\" text,\n \"name\" text,\n \"type\" text,\n \"elevation\" text\n);\n\nQuestion: Tell me the name with s\u00f8r-tr\u00f8ndelag" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"see_also\" WHERE \"county\"='s\u00f8r-tr\u00f8ndelag';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"see_also\" (\n \"rank\" real,\n \"county\" text,\n \"name\" text,\n \"type\" text,\n \"elevation\" text\n);\n\nQuestion: Tell me the elevation for oslo" }, { "role": "assistant", "content": "SELECT \"elevation\" FROM \"see_also\" WHERE \"county\"='oslo';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"professional_boxing_record\" (\n \"result\" text,\n \"opponent\" text,\n \"type\" text,\n \"rd_time\" text,\n \"date\" text\n);\n\nQuestion: What was the result of the match against Pat Lawlor?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"professional_boxing_record\" WHERE \"opponent\"='pat lawlor';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"fleet\" (\n \"class\" text,\n \"operator\" text,\n \"no_built\" real,\n \"year_built\" text,\n \"cars_per_set\" real\n);\n\nQuestion: Tell me the sum of cars per set for operator of london midland" }, { "role": "assistant", "content": "SELECT SUM(\"cars_per_set\") FROM \"fleet\" WHERE \"operator\"='london midland';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the title of japan january 31, 2008" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"game_releases_in_japan\" WHERE \"japan\"='january 31, 2008';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me japan for jigsaw land: japan graffiti" }, { "role": "assistant", "content": "SELECT \"japan\" FROM \"game_releases_in_japan\" WHERE \"title\"='jigsaw land: japan graffiti';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me north america for january 23, 2013" }, { "role": "assistant", "content": "SELECT \"north_america\" FROM \"game_releases_in_japan\" WHERE \"japan\"='january 23, 2013';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the north america for september 18, 2009" }, { "role": "assistant", "content": "SELECT \"north_america\" FROM \"game_releases_in_japan\" WHERE \"europe\"='september 18, 2009';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me europe for japan of january 28, 2010" }, { "role": "assistant", "content": "SELECT \"europe\" FROM \"game_releases_in_japan\" WHERE \"japan\"='january 28, 2010';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_releases_in_japan\" (\n \"title\" text,\n \"japan\" text,\n \"north_america\" text,\n \"europe\" text,\n \"australia\" text\n);\n\nQuestion: Tell me the north america for phantom brave" }, { "role": "assistant", "content": "SELECT \"north_america\" FROM \"game_releases_in_japan\" WHERE \"title\"='phantom brave';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"home_stadiums\" (\n \"venue\" text,\n \"city\" text,\n \"first_international\" text,\n \"last_international\" text,\n \"played\" real,\n \"draw\" real,\n \"lost\" real,\n \"average_attendance\" real\n);\n\nQuestion: What is the average played value in Belgrade with attendance greater than 26,222?" }, { "role": "assistant", "content": "SELECT AVG(\"played\") FROM \"home_stadiums\" WHERE \"city\"='belgrade' AND \"average_attendance\">'26,222';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"theater_credits\" (\n \"year\" real,\n \"play\" text,\n \"role\" text,\n \"theatre\" text,\n \"location\" text\n);\n\nQuestion: Tell me the role of festival theatre" }, { "role": "assistant", "content": "SELECT \"role\" FROM \"theater_credits\" WHERE \"theatre\"='festival theatre';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"theater_credits\" (\n \"year\" real,\n \"play\" text,\n \"role\" text,\n \"theatre\" text,\n \"location\" text\n);\n\nQuestion: Tell me the lowest year for shubert theatre" }, { "role": "assistant", "content": "SELECT MIN(\"year\") FROM \"theater_credits\" WHERE \"theatre\"='shubert theatre';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"theater_credits\" (\n \"year\" real,\n \"play\" text,\n \"role\" text,\n \"theatre\" text,\n \"location\" text\n);\n\nQuestion: Tell me the total number of years for lady cecily waynflete and opera house, kennedy center" }, { "role": "assistant", "content": "SELECT COUNT(\"year\") FROM \"theater_credits\" WHERE \"role\"='lady cecily waynflete' AND \"theatre\"='opera house, kennedy center';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"theater_credits\" (\n \"year\" real,\n \"play\" text,\n \"role\" text,\n \"theatre\" text,\n \"location\" text\n);\n\nQuestion: Tell me the role for tea and sympathy" }, { "role": "assistant", "content": "SELECT \"role\" FROM \"theater_credits\" WHERE \"play\"='tea and sympathy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"saints\" (\n \"name\" text,\n \"martyred\" real,\n \"place\" text,\n \"beatified\" real,\n \"canonised\" real\n);\n\nQuestion: When was the first beatification in Korea that was canonised before 1984?" }, { "role": "assistant", "content": "SELECT MIN(\"beatified\") FROM \"saints\" WHERE \"place\"='korea' AND \"canonised\"<1984;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"saints\" (\n \"name\" text,\n \"martyred\" real,\n \"place\" text,\n \"beatified\" real,\n \"canonised\" real\n);\n\nQuestion: When was Laurent-Marie-Joseph Imbert / St. Imbert, who was beatified after 1909 and canonised after 1984, martyred?" }, { "role": "assistant", "content": "SELECT MAX(\"martyred\") FROM \"saints\" WHERE \"beatified\">1909 AND \"name\"='laurent-marie-joseph imbert / st. imbert' AND \"canonised\">1984;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"saints\" (\n \"name\" text,\n \"martyred\" real,\n \"place\" text,\n \"beatified\" real,\n \"canonised\" real\n);\n\nQuestion: When was the person(s) who were canonised before 1988 beatified?" }, { "role": "assistant", "content": "SELECT \"beatified\" FROM \"saints\" WHERE \"canonised\"<1988;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"saints\" (\n \"name\" text,\n \"martyred\" real,\n \"place\" text,\n \"beatified\" real,\n \"canonised\" real\n);\n\nQuestion: When was John Hoan Trinh Doan / St. John Hoan, who was beatified in 1909 and canonised after 1988, martyred?" }, { "role": "assistant", "content": "SELECT MAX(\"martyred\") FROM \"saints\" WHERE \"beatified\"=1909 AND \"name\"='john hoan trinh doan / st. john hoan' AND \"canonised\">1988;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"year\" real,\n \"conference\" text,\n \"city\" text,\n \"country\" text,\n \"local_host_s\" text\n);\n\nQuestion: What is the sum of year with the local host Sai?" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"references\" WHERE \"local_host_s\"='sai';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"year\" real,\n \"conference\" text,\n \"city\" text,\n \"country\" text,\n \"local_host_s\" text\n);\n\nQuestion: Who are the local hosts for the United States in years earlier than 2007?" }, { "role": "assistant", "content": "SELECT \"local_host_s\" FROM \"references\" WHERE \"country\"='united states' AND \"year\"<2007;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"references\" (\n \"year\" real,\n \"conference\" text,\n \"city\" text,\n \"country\" text,\n \"local_host_s\" text\n);\n\nQuestion: Which city has a conference of LCC2 and a year earlier than 2009?" }, { "role": "assistant", "content": "SELECT \"city\" FROM \"references\" WHERE \"year\"<2009 AND \"conference\"='lcc2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_am_rolex_sports_car_series_results\" (\n \"year\" real,\n \"team\" text,\n \"make\" text,\n \"engine\" text,\n \"class\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: Tell me the class with rank of 89th" }, { "role": "assistant", "content": "SELECT \"class\" FROM \"grand_am_rolex_sports_car_series_results\" WHERE \"rank\"='89th';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"grand_am_rolex_sports_car_series_results\" (\n \"year\" real,\n \"team\" text,\n \"make\" text,\n \"engine\" text,\n \"class\" text,\n \"rank\" text,\n \"points\" real\n);\n\nQuestion: Tell me the most year for 3 points" }, { "role": "assistant", "content": "SELECT MAX(\"year\") FROM \"grand_am_rolex_sports_car_series_results\" WHERE \"points\"=3;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"heats\" (\n \"heat_rank\" real,\n \"lane\" real,\n \"swimmer\" text,\n \"country\" text,\n \"time\" real,\n \"overall_rank\" real\n);\n\nQuestion: Which lane is Goksu Bicer in?" }, { "role": "assistant", "content": "SELECT \"lane\" FROM \"heats\" WHERE \"swimmer\"='goksu bicer';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which Driver that has a Grid less than 9 and a Time/Retired of 2:06:26.358?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"race\" WHERE \"grid\"<9 AND \"time_retired\"='2:06:26.358';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which driver drove a Ferrari in the 2007 European Grand Prix with a grid less than 3?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"race\" WHERE \"constructor\"='ferrari' AND \"grid\"<3;" } ]
[ { "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: Name the location of ufc 98" }, { "role": "assistant", "content": "SELECT \"location\" FROM \"mixed_martial_arts_record\" WHERE \"event\"='ufc 98';" } ]
[ { "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_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the smallest number of wins for the Totals Tournament with a Top-25 value greater than 3?" }, { "role": "assistant", "content": "SELECT MIN(\"wins\") FROM \"summary\" WHERE \"tournament\"='totals' AND \"top_25\">3;" } ]
[ { "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_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the sum of Top-5 values with events values less than 2?" }, { "role": "assistant", "content": "SELECT SUM(\"top_5\") FROM \"summary\" WHERE \"events\"<2;" } ]
[ { "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_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the smallest value for Wins when the number of cuts is greater than 4 and the Top-5 value is less than 1?" }, { "role": "assistant", "content": "SELECT MIN(\"wins\") FROM \"summary\" WHERE \"cuts_made\">4 AND \"top_5\"<1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: Tell me the competition for 2nd position with year more than 2005" }, { "role": "assistant", "content": "SELECT \"competition\" FROM \"achievements\" WHERE \"position\"='2nd' AND \"year\">2005;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: Name the sum of year for 2nd position for junior race" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"achievements\" WHERE \"position\"='2nd' AND \"event\"='junior race';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"achievements\" (\n \"year\" real,\n \"competition\" text,\n \"venue\" text,\n \"position\" text,\n \"event\" text\n);\n\nQuestion: Name the venue for 2nd position of year before 2008" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"achievements\" WHERE \"year\"<2008 AND \"position\"='2nd';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"non_championship_grands_prix\" (\n \"name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: Which circuit did Raymond Mays win?" }, { "role": "assistant", "content": "SELECT \"circuit\" FROM \"non_championship_grands_prix\" WHERE \"winning_driver\"='raymond mays';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"non_championship_grands_prix\" (\n \"name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"winning_constructor\" text,\n \"report\" text\n);\n\nQuestion: Which Circuit did Johnny Wakefield win?" }, { "role": "assistant", "content": "SELECT \"circuit\" FROM \"non_championship_grands_prix\" WHERE \"winning_driver\"='johnny wakefield';" } ]
[ { "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: Tell me the lowest bronze for panama and total larger than 8" }, { "role": "assistant", "content": "SELECT MIN(\"bronze\") FROM \"medal_table\" WHERE \"nation\"='panama' AND \"total\">8;" } ]
[ { "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: Tell me the average total for guatemala and bronze less than 2" }, { "role": "assistant", "content": "SELECT AVG(\"total\") FROM \"medal_table\" WHERE \"nation\"='guatemala' AND \"bronze\"<2;" } ]