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 \"uefa_club_competitions_record\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"result\" text,\n \"venue\" text\n);\n\nQuestion: Which season has a Result of 6\u20139?" }, { "role": "assistant", "content": "SELECT \"season\" FROM \"uefa_club_competitions_record\" WHERE \"result\"='6\u20139';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"uefa_club_competitions_record\" (\n \"season\" text,\n \"competition\" text,\n \"round\" text,\n \"opponent\" text,\n \"result\" text,\n \"venue\" text\n);\n\nQuestion: Which round has a Venue of nicosia, and a Opponent of levski sofia zapad?" }, { "role": "assistant", "content": "SELECT \"round\" FROM \"uefa_club_competitions_record\" WHERE \"venue\"='nicosia' AND \"opponent\"='levski sofia zapad';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What resulted in a score of 22-21?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"2003_fixtures_and_results\" WHERE \"score\"='22-21';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What competition was held on the date 6/7/03" }, { "role": "assistant", "content": "SELECT \"competition\" FROM \"2003_fixtures_and_results\" WHERE \"date\"='6/7/03';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What was the score for the date of 15/6/03" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"2003_fixtures_and_results\" WHERE \"date\"='15/6/03';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What venue is on the date of 8/6/03" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"2003_fixtures_and_results\" WHERE \"date\"='8/6/03';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What outcome has a score of 12-22?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"2003_fixtures_and_results\" WHERE \"score\"='12-22';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2003_fixtures_and_results\" (\n \"date\" text,\n \"competition\" text,\n \"venue\" text,\n \"result\" text,\n \"score\" text\n);\n\nQuestion: What date is for Venue of jjb stadium, and a Result of w?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"2003_fixtures_and_results\" WHERE \"venue\"='jjb stadium' AND \"result\"='w';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What is the high lap total for fran\u00e7ois cevert?" }, { "role": "assistant", "content": "SELECT MAX(\"laps\") FROM \"classification\" WHERE \"driver\"='fran\u00e7ois cevert';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Who constructed rolf stommelen's car?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"classification\" WHERE \"driver\"='rolf stommelen';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Who drive the car that retired due to engine failure and a grid of less than 9?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"classification\" WHERE \"time_retired\"='engine' AND \"grid\"<9;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"track_records\" (\n \"record\" text,\n \"date\" text,\n \"driver\" text,\n \"time\" text,\n \"speed_avg_speed\" text\n);\n\nQuestion: When was the race that set the record for the Izod Indycar Series?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"track_records\" WHERE \"record\"='izod indycar series';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"track_records\" (\n \"record\" text,\n \"date\" text,\n \"driver\" text,\n \"time\" text,\n \"speed_avg_speed\" text\n);\n\nQuestion: Which driver set the Qualifying record with a time of 24.761 seconds?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"track_records\" WHERE \"record\"='qualifying' AND \"time\"='24.761';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"f\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What Utah Jazz guard, played at BYU?" }, { "role": "assistant", "content": "SELECT \"player\" FROM \"f\" WHERE \"position\"='guard' AND \"school_club_team\"='byu';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"f\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What college team did Derek Fisher play for?" }, { "role": "assistant", "content": "SELECT \"school_club_team\" FROM \"f\" WHERE \"player\"='derek fisher';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"f\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: The Utah Jazz Player from UTEP was what nationality?" }, { "role": "assistant", "content": "SELECT \"nationality\" FROM \"f\" WHERE \"school_club_team\"='utep';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the name of the venue when the home team is Richmond?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"round_10\" WHERE \"home_team\"='richmond';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the date of the game when the away team score is 15.14 (104)?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_10\" WHERE \"away_team_score\"='15.14 (104)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Who is the away team when the crowd is larger than 21,122 and the home team score is 13.7 (85)?" }, { "role": "assistant", "content": "SELECT \"away_team\" FROM \"round_10\" WHERE \"crowd\">'21,122' AND \"home_team_score\"='13.7 (85)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_10\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the home team score when the venue is Princes Park?" }, { "role": "assistant", "content": "SELECT \"home_team_score\" FROM \"round_10\" WHERE \"venue\"='princes park';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"leaders\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"earnings\" real,\n \"wins\" real\n);\n\nQuestion: How many wins did Hale Irwin get with earnings smaller than 20,592,965?" }, { "role": "assistant", "content": "SELECT SUM(\"wins\") FROM \"leaders\" WHERE \"player\"='hale irwin' AND \"earnings\"<'20,592,965';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"law_enforcement\" (\n \"character\" text,\n \"position\" text,\n \"actor\" text,\n \"first_episode\" text,\n \"final_episode\" text,\n \"duration\" text,\n \"final_episode_count\" real\n);\n\nQuestion: What actor plays glen cole?" }, { "role": "assistant", "content": "SELECT \"actor\" FROM \"law_enforcement\" WHERE \"character\"='glen cole';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"law_enforcement\" (\n \"character\" text,\n \"position\" text,\n \"actor\" text,\n \"first_episode\" text,\n \"final_episode\" text,\n \"duration\" text,\n \"final_episode_count\" real\n);\n\nQuestion: What is the average number for a final episode featuring maxine valera?" }, { "role": "assistant", "content": "SELECT AVG(\"final_episode_count\") FROM \"law_enforcement\" WHERE \"character\"='maxine valera';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: How many laps were driven in 2:54:23.8?" }, { "role": "assistant", "content": "SELECT SUM(\"laps\") FROM \"classification\" WHERE \"time_retired\"='2:54:23.8';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which constructor has laps less than 100 and a time/retired +10 laps?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"classification\" WHERE \"laps\"<100 AND \"time_retired\"='+10 laps';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What are the highest number of laps for grid 8?" }, { "role": "assistant", "content": "SELECT MAX(\"laps\") FROM \"classification\" WHERE \"grid\"=8;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which grid is the highest and has a time/retired of +0.3?" }, { "role": "assistant", "content": "SELECT MAX(\"grid\") FROM \"classification\" WHERE \"time_retired\"='+0.3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: Which driver for Maserati has more laps than 23 and a grid greater than 7?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"classification\" WHERE \"constructor\"='maserati' AND \"laps\">23 AND \"grid\">7;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification_leadership_by_stage\" (\n \"stage\" text,\n \"winner\" text,\n \"general_classification\" text,\n \"points_classification\" text,\n \"trofeo_fast_team\" text\n);\n\nQuestion: Which points classification shares a general classification of Bernard Hinault, a Trofeo Fast Tem of Bianchi, was won by Urs Freuler, and was stage 4?" }, { "role": "assistant", "content": "SELECT \"points_classification\" FROM \"classification_leadership_by_stage\" WHERE \"general_classification\"='bernard hinault' AND \"trofeo_fast_team\"='bianchi' AND \"winner\"='urs freuler' AND \"stage\"='4';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification_leadership_by_stage\" (\n \"stage\" text,\n \"winner\" text,\n \"general_classification\" text,\n \"points_classification\" text,\n \"trofeo_fast_team\" text\n);\n\nQuestion: Who was the winner that had a Points Classification of Giuseppe Saronni, a Trofeo Fast Team of Bianchi, and was Stage 3?" }, { "role": "assistant", "content": "SELECT \"winner\" FROM \"classification_leadership_by_stage\" WHERE \"points_classification\"='giuseppe saronni' AND \"trofeo_fast_team\"='bianchi' AND \"stage\"='3';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification_leadership_by_stage\" (\n \"stage\" text,\n \"winner\" text,\n \"general_classification\" text,\n \"points_classification\" text,\n \"trofeo_fast_team\" text\n);\n\nQuestion: Which stage had a Points Classification of Francesco Moser and a general classification of Bernard Hinault?" }, { "role": "assistant", "content": "SELECT \"stage\" FROM \"classification_leadership_by_stage\" WHERE \"points_classification\"='francesco moser' AND \"general_classification\"='bernard hinault';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification_leadership_by_stage\" (\n \"stage\" text,\n \"winner\" text,\n \"general_classification\" text,\n \"points_classification\" text,\n \"trofeo_fast_team\" text\n);\n\nQuestion: Who was the winner of Stage 12 with a Points Classification of Francesco Moser?" }, { "role": "assistant", "content": "SELECT \"winner\" FROM \"classification_leadership_by_stage\" WHERE \"points_classification\"='francesco moser' AND \"stage\"='12';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification_leadership_by_stage\" (\n \"stage\" text,\n \"winner\" text,\n \"general_classification\" text,\n \"points_classification\" text,\n \"trofeo_fast_team\" text\n);\n\nQuestion: Which stage was won by Bernard Hinault and had a Points classification of Francesco Moser?" }, { "role": "assistant", "content": "SELECT \"stage\" FROM \"classification_leadership_by_stage\" WHERE \"winner\"='bernard hinault' AND \"points_classification\"='francesco moser';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1970s_raiders_12_6_2\" (\n \"year\" real,\n \"date\" text,\n \"winner\" text,\n \"result\" text,\n \"loser\" text,\n \"location\" text\n);\n\nQuestion: Who was the loser on December 12, 1971?" }, { "role": "assistant", "content": "SELECT \"loser\" FROM \"1970s_raiders_12_6_2\" WHERE \"date\"='december 12' AND \"year\"=1971;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1970s_raiders_12_6_2\" (\n \"year\" real,\n \"date\" text,\n \"winner\" text,\n \"result\" text,\n \"loser\" text,\n \"location\" text\n);\n\nQuestion: Who was the loser at Municipal Stadium after 1970?" }, { "role": "assistant", "content": "SELECT \"loser\" FROM \"1970s_raiders_12_6_2\" WHERE \"location\"='municipal stadium' AND \"year\">1970;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1970s_raiders_12_6_2\" (\n \"year\" real,\n \"date\" text,\n \"winner\" text,\n \"result\" text,\n \"loser\" text,\n \"location\" text\n);\n\nQuestion: What is the date where the winner was the Oakland Raiders in 1975?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"1970s_raiders_12_6_2\" WHERE \"year\"=1975 AND \"winner\"='oakland raiders';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"1970s_raiders_12_6_2\" (\n \"year\" real,\n \"date\" text,\n \"winner\" text,\n \"result\" text,\n \"loser\" text,\n \"location\" text\n);\n\nQuestion: What is result of the game at Arrowhead Stadium where the loser was the Kansas City Chiefs?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"1970s_raiders_12_6_2\" WHERE \"location\"='arrowhead stadium' AND \"loser\"='kansas city chiefs';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"dora_1999_7_march_1999\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"points\" real,\n \"place\" real\n);\n\nQuestion: What draw for \"ljubav jedne \u017eene\" with under 153 points?" }, { "role": "assistant", "content": "SELECT SUM(\"draw\") FROM \"dora_1999_7_march_1999\" WHERE \"song\"='\\\"ljubav jedne \u017eene\\\"' AND \"points\"<153;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"dora_1999_7_march_1999\" (\n \"draw\" real,\n \"artist\" text,\n \"song\" text,\n \"points\" real,\n \"place\" real\n);\n\nQuestion: What place for \"jednom u \u017eivotu\" with a draw larger than 18?" }, { "role": "assistant", "content": "SELECT COUNT(\"place\") FROM \"dora_1999_7_march_1999\" WHERE \"song\"='\\\"jednom u \u017eivotu\\\"' AND \"draw\">18;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"awards\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"work\" text,\n \"result\" text\n);\n\nQuestion: What was nominated for the Best Movie category?" }, { "role": "assistant", "content": "SELECT \"work\" FROM \"awards\" WHERE \"category\"='best movie';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"awards\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"work\" text,\n \"result\" text\n);\n\nQuestion: Which award did Scream receive a nomination and/or win for in 1997?" }, { "role": "assistant", "content": "SELECT \"award\" FROM \"awards\" WHERE \"work\"='scream' AND \"year\"=1997;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"awards\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"work\" text,\n \"result\" text\n);\n\nQuestion: What category was Scream nominated for at the International Horror Guild?" }, { "role": "assistant", "content": "SELECT \"category\" FROM \"awards\" WHERE \"work\"='scream' AND \"award\"='international horror guild';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the time/retired when the laps is less than 54 and the driver is mark donohue?" }, { "role": "assistant", "content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"laps\"<54 AND \"driver\"='mark donohue';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the grid when the driver is mario andretti and the laps is less than 54?" }, { "role": "assistant", "content": "SELECT MAX(\"grid\") FROM \"classification\" WHERE \"driver\"='mario andretti' AND \"laps\"<54;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: how many laps were there when the grid was 24?" }, { "role": "assistant", "content": "SELECT COUNT(\"laps\") FROM \"classification\" WHERE \"grid\"=24;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"classification\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: what is the time/retired when the laps is 6, the grid is less than 18 and the driver is clay regazzoni?" }, { "role": "assistant", "content": "SELECT \"time_retired\" FROM \"classification\" WHERE \"laps\"=6 AND \"grid\"<18 AND \"driver\"='clay regazzoni';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"barry_railway\" (\n \"class\" text,\n \"type\" text,\n \"quantity\" real,\n \"barry_nos\" text,\n \"gwr_nos\" text\n);\n\nQuestion: Which class is smaller than 5 and the GWR is 1322\u20131323?" }, { "role": "assistant", "content": "SELECT \"class\" FROM \"barry_railway\" WHERE \"quantity\"<5 AND \"gwr_nos\"='1322\u20131323';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"sources\" (\n \"name\" text,\n \"party\" text,\n \"province\" text,\n \"term_expires\" real,\n \"term_of_office\" text\n);\n\nQuestion: Whose term expired in 1996 and was from the province of Central Highlands?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"sources\" WHERE \"province\"='central highlands' AND \"term_expires\"=1996;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"sources\" (\n \"name\" text,\n \"party\" text,\n \"province\" text,\n \"term_expires\" real,\n \"term_of_office\" text\n);\n\nQuestion: Ken Wright of the National Party was from which province?" }, { "role": "assistant", "content": "SELECT \"province\" FROM \"sources\" WHERE \"party\"='national' AND \"name\"='ken wright';" } ]
[ { "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 \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"event\" text\n);\n\nQuestion: Which venue hosted a race in 1967?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"achievements\" WHERE \"year\"=1967;" } ]
[ { "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 \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"event\" text\n);\n\nQuestion: Which tournament was held after 1966?" }, { "role": "assistant", "content": "SELECT \"tournament\" FROM \"achievements\" WHERE \"year\">1966;" } ]
[ { "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 \"tournament\" text,\n \"venue\" text,\n \"result\" text,\n \"event\" text\n);\n\nQuestion: Which venue hosted a tournament in 1965?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"achievements\" WHERE \"year\"=1965;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"original_london_production\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: What is the result for the best new musical nominee?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"original_london_production\" WHERE \"nominee\"='best new musical';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"original_london_production\" (\n \"year\" real,\n \"award\" text,\n \"category\" text,\n \"nominee\" text,\n \"result\" text\n);\n\nQuestion: How many years does simon baker appear as a nominee?" }, { "role": "assistant", "content": "SELECT COUNT(\"year\") FROM \"original_london_production\" WHERE \"nominee\"='simon baker';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"f\" (\n \"player\" text,\n \"no_s\" text,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: What is the Height for Years of Rockets of 2005-06?" }, { "role": "assistant", "content": "SELECT \"height_in_ft\" FROM \"f\" WHERE \"years_for_rockets\"='2005-06';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"f\" (\n \"player\" text,\n \"no_s\" text,\n \"height_in_ft\" text,\n \"position\" text,\n \"years_for_rockets\" text,\n \"school_club_team_country\" text\n);\n\nQuestion: What is the Height for Years for Rockets of 2005-06?" }, { "role": "assistant", "content": "SELECT \"height_in_ft\" FROM \"f\" WHERE \"years_for_rockets\"='2005-06';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What is the Attendance on august 15?" }, { "role": "assistant", "content": "SELECT \"attendance\" FROM \"game_log\" WHERE \"date\"='august 15';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"season_review\" (\n \"race\" text,\n \"date\" text,\n \"location\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"race_winner\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the constructor for the race with Nigel Mansell as the fastest lap?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"season_review\" WHERE \"fastest_lap\"='nigel mansell';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"season_review\" (\n \"race\" text,\n \"date\" text,\n \"location\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"race_winner\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the fastest lap at estoril?" }, { "role": "assistant", "content": "SELECT \"fastest_lap\" FROM \"season_review\" WHERE \"location\"='estoril';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"season_review\" (\n \"race\" text,\n \"date\" text,\n \"location\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"race_winner\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: What is the race in Paul Ricard with Keke Rosberg as the fastest lap?" }, { "role": "assistant", "content": "SELECT \"race\" FROM \"season_review\" WHERE \"fastest_lap\"='keke rosberg' AND \"location\"='paul ricard';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"season_review\" (\n \"race\" text,\n \"date\" text,\n \"location\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"race_winner\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: Who was the winner at spa-francorchamps?" }, { "role": "assistant", "content": "SELECT \"race_winner\" FROM \"season_review\" WHERE \"location\"='spa-francorchamps';" } ]
[ { "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: Where was the game with result 7-2 played?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"international_goals\" WHERE \"result\"='7-2';" } ]
[ { "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 was the score of the Friendly competition where the result was 7-2?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"international_goals\" WHERE \"competition\"='friendly' AND \"result\"='7-2';" } ]
[ { "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 was the score of the game on 27 January 1996?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"international_goals\" WHERE \"date\"='27 january 1996';" } ]
[ { "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 event with a result of 3-2?" }, { "role": "assistant", "content": "SELECT \"competition\" FROM \"international_goals\" WHERE \"result\"='3-2';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_21\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: How big was the crowd size, at the Junction Oval venue?" }, { "role": "assistant", "content": "SELECT SUM(\"crowd\") FROM \"round_21\" WHERE \"venue\"='junction oval';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_21\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the visiting team of Melbourne's score?" }, { "role": "assistant", "content": "SELECT \"away_team_score\" FROM \"round_21\" WHERE \"away_team\"='melbourne';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_21\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What is the average crowd size of Fitzroy's home team?" }, { "role": "assistant", "content": "SELECT AVG(\"crowd\") FROM \"round_21\" WHERE \"home_team\"='fitzroy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"railway\" text,\n \"loco_name\" text,\n \"build_date\" real,\n \"wheels\" text,\n \"disposal\" text\n);\n\nQuestion: Which railway had the earliest build date and a disposal of \"Scrapped 1941?\"" }, { "role": "assistant", "content": "SELECT MIN(\"build_date\") FROM \"locomotives\" WHERE \"disposal\"='scrapped 1941';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"railway\" text,\n \"loco_name\" text,\n \"build_date\" real,\n \"wheels\" text,\n \"disposal\" text\n);\n\nQuestion: Which railway had a loco name of Pyramus and a build date of 1911?" }, { "role": "assistant", "content": "SELECT \"railway\" FROM \"locomotives\" WHERE \"build_date\"=1911 AND \"loco_name\"='pyramus';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives\" (\n \"railway\" text,\n \"loco_name\" text,\n \"build_date\" real,\n \"wheels\" text,\n \"disposal\" text\n);\n\nQuestion: What was the build date of the railway(s) with 0-6-2 t wheels?" }, { "role": "assistant", "content": "SELECT \"build_date\" FROM \"locomotives\" WHERE \"wheels\"='0-6-2 t';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"sports\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real,\n \"disbanded\" text,\n \"championships\" text\n);\n\nQuestion: Which disbanded is in the ahl league?" }, { "role": "assistant", "content": "SELECT \"disbanded\" FROM \"sports\" WHERE \"league\"='ahl';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"sports\" (\n \"club\" text,\n \"league\" text,\n \"sport\" text,\n \"venue\" text,\n \"established\" real,\n \"disbanded\" text,\n \"championships\" text\n);\n\nQuestion: Which championship was established after 2005?" }, { "role": "assistant", "content": "SELECT \"championships\" FROM \"sports\" WHERE \"established\">2005;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"boys_basketball_players_and_coaches_of_t\" (\n \"year\" text,\n \"player\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: Which year had J.R. Reid as a player?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"boys_basketball_players_and_coaches_of_t\" WHERE \"player\"='j.r. reid';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"boys_basketball_players_and_coaches_of_t\" (\n \"year\" text,\n \"player\" text,\n \"school\" text,\n \"hometown\" text,\n \"college\" text,\n \"nba_draft\" text\n);\n\nQuestion: Which hometown is the played Dajuan Wagner from?" }, { "role": "assistant", "content": "SELECT \"hometown\" FROM \"boys_basketball_players_and_coaches_of_t\" WHERE \"player\"='dajuan wagner';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_1\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: When the home team was carlton how many people were in the crowd?" }, { "role": "assistant", "content": "SELECT \"crowd\" FROM \"round_1\" WHERE \"home_team\"='carlton';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_1\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: Which away team had a crowd of over 23,000 people?" }, { "role": "assistant", "content": "SELECT \"away_team\" FROM \"round_1\" WHERE \"crowd\">'23,000';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_1\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What's the home team for the western oval venue?" }, { "role": "assistant", "content": "SELECT \"home_team\" FROM \"round_1\" WHERE \"venue\"='western oval';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_1\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What's the home team for the junction oval venue?" }, { "role": "assistant", "content": "SELECT \"home_team_score\" FROM \"round_1\" WHERE \"venue\"='junction oval';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_1\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What date did the away team score 13.10 (88)?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_1\" WHERE \"away_team_score\"='13.10 (88)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"uefa_cup\" (\n \"date_and_time\" text,\n \"round\" text,\n \"opponent\" text,\n \"venue\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the result when the opponent was fenerbah\u00e7e?" }, { "role": "assistant", "content": "SELECT \"result\" FROM \"uefa_cup\" WHERE \"opponent\"='fenerbah\u00e7e';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"6001_6100\" (\n \"ngc_number\" text,\n \"object_type\" text,\n \"constellation\" text,\n \"right_ascension_j2000\" text,\n \"declination_j2000\" text,\n \"apparent_magnitude\" real\n);\n\nQuestion: what is the apparent magnitude of NGC number 6027d?" }, { "role": "assistant", "content": "SELECT \"apparent_magnitude\" FROM \"6001_6100\" WHERE \"ngc_number\"='6027d';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"november\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"record\" text\n);\n\nQuestion: What is the visiting team of the game with the home team Grizzlies on 13 November 2007?" }, { "role": "assistant", "content": "SELECT \"visitor\" FROM \"november\" WHERE \"home\"='grizzlies' AND \"date\"='13 november 2007';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"november\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"leading_scorer\" text,\n \"record\" text\n);\n\nQuestion: What is the date of the game when the Mavericks were the home team?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"november\" WHERE \"home\"='mavericks';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives_of_the_southern_railway\" (\n \"iwcr_no\" text,\n \"name\" text,\n \"wheel_arrangement\" text,\n \"sr_no\" text,\n \"year_made\" real,\n \"year_withdrawn\" real\n);\n\nQuestion: Which of the lowest years had a Wheel arrangement that was 0-4-2t?" }, { "role": "assistant", "content": "SELECT MIN(\"year_made\") FROM \"locomotives_of_the_southern_railway\" WHERE \"wheel_arrangement\"='0-4-2t';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives_of_the_southern_railway\" (\n \"iwcr_no\" text,\n \"name\" text,\n \"wheel_arrangement\" text,\n \"sr_no\" text,\n \"year_made\" real,\n \"year_withdrawn\" real\n);\n\nQuestion: What is the mean Year when the IWCR number was 5 and the Year withdrawn was bigger than 1926?" }, { "role": "assistant", "content": "SELECT AVG(\"year_made\") FROM \"locomotives_of_the_southern_railway\" WHERE \"iwcr_no\"='5' AND \"year_withdrawn\">1926;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives_of_the_southern_railway\" (\n \"iwcr_no\" text,\n \"name\" text,\n \"wheel_arrangement\" text,\n \"sr_no\" text,\n \"year_made\" real,\n \"year_withdrawn\" real\n);\n\nQuestion: Which SR number had a wheel arrangement of 0-6-0t, the year made was more recent than 1874, and the year withdrawn was 1963?" }, { "role": "assistant", "content": "SELECT \"sr_no\" FROM \"locomotives_of_the_southern_railway\" WHERE \"wheel_arrangement\"='0-6-0t' AND \"year_made\">1874 AND \"year_withdrawn\"=1963;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"locomotives_of_the_southern_railway\" (\n \"iwcr_no\" text,\n \"name\" text,\n \"wheel_arrangement\" text,\n \"sr_no\" text,\n \"year_made\" real,\n \"year_withdrawn\" real\n);\n\nQuestion: What is the sum number of years where the wheel arrangement of 0-4-0t?" }, { "role": "assistant", "content": "SELECT COUNT(\"year_made\") FROM \"locomotives_of_the_southern_railway\" WHERE \"wheel_arrangement\"='0-4-0t';" } ]
[ { "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 was the latest week of a game that had an attendance of 63,001?" }, { "role": "assistant", "content": "SELECT MAX(\"week\") FROM \"schedule\" WHERE \"attendance\"='63,001';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the total medals Austria and those with larger than rank 4 have?" }, { "role": "assistant", "content": "SELECT COUNT(\"total\") FROM \"medal_table\" WHERE \"nation\"='austria' AND \"rank\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"medal_table\" (\n \"rank\" real,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: What is the most gold medals that a team ranked higher than 6, have 1 silver medal, and more than 4 total medals have?" }, { "role": "assistant", "content": "SELECT MAX(\"gold\") FROM \"medal_table\" WHERE \"rank\"<6 AND \"silver\"=1 AND \"total\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_operating_reverchon_roller_coast\" (\n \"name\" text,\n \"model\" text,\n \"park\" text,\n \"country\" text,\n \"opened\" real\n);\n\nQuestion: Which country has a rollercoaster that opened in 2002, is a spinning coaster, and is located in Disney's Animal Kingdom?" }, { "role": "assistant", "content": "SELECT \"country\" FROM \"list_of_operating_reverchon_roller_coast\" WHERE \"opened\"=2002 AND \"model\"='spinning coaster' AND \"park\"='disney''s animal kingdom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"list_of_operating_reverchon_roller_coast\" (\n \"name\" text,\n \"model\" text,\n \"park\" text,\n \"country\" text,\n \"opened\" real\n);\n\nQuestion: What is the name of the roller coaster that opened in 2000 in Brighton Pier?" }, { "role": "assistant", "content": "SELECT \"name\" FROM \"list_of_operating_reverchon_roller_coast\" WHERE \"opened\"=2000 AND \"park\"='brighton pier';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: How many attended on may 6?" }, { "role": "assistant", "content": "SELECT COUNT(\"attendance\") FROM \"game_log\" WHERE \"date\"='may 6';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"date\" text,\n \"opponent\" text,\n \"score\" text,\n \"loss\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: Who did they lose to 3-17?" }, { "role": "assistant", "content": "SELECT \"opponent\" FROM \"game_log\" WHERE \"score\"='3-17';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What team was the home team when the away team scored 12.11 (83)?" }, { "role": "assistant", "content": "SELECT \"home_team\" FROM \"round_12\" WHERE \"away_team_score\"='12.11 (83)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What venue did Richmond play at as the home team?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"round_12\" WHERE \"home_team\"='richmond';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What home team played against Footscray as the away team?" }, { "role": "assistant", "content": "SELECT \"home_team\" FROM \"round_12\" WHERE \"away_team\"='footscray';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_12\" (\n \"home_team\" text,\n \"home_team_score\" text,\n \"away_team\" text,\n \"away_team_score\" text,\n \"venue\" text,\n \"crowd\" real,\n \"date\" text\n);\n\nQuestion: What date did the away team score 14.8 (92)?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_12\" WHERE \"away_team_score\"='14.8 (92)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"ties\" (\n \"tie_no\" real,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"attendance\" real\n);\n\nQuestion: what was the attendance when the away team was boreham wood?" }, { "role": "assistant", "content": "SELECT \"attendance\" FROM \"ties\" WHERE \"away_team\"='boreham wood';" } ]