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 \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"europe\" real,\n \"total\" real\n);\n\nQuestion: How many league cup goals on average for players with over 0 FA cup and 5 league goals?" }, { "role": "assistant", "content": "SELECT AVG(\"league_cup\") FROM \"goalscorers\" WHERE \"fa_cup\">0 AND \"league\"=5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"goalscorers\" (\n \"name\" text,\n \"league\" real,\n \"fa_cup\" real,\n \"league_cup\" real,\n \"europe\" real,\n \"total\" real\n);\n\nQuestion: What is the low FA cup goals for viduka with under 2 europe goals?" }, { "role": "assistant", "content": "SELECT MIN(\"fa_cup\") FROM \"goalscorers\" WHERE \"name\"='viduka' AND \"europe\"<2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"awards_and_nominations\" (\n \"year\" real,\n \"association\" text,\n \"category\" text,\n \"nominated_work\" text,\n \"result\" text\n);\n\nQuestion: Who won the most recent favorite rap/hip-hop new artist at the American music awards?" }, { "role": "assistant", "content": "SELECT MAX(\"year\") FROM \"awards_and_nominations\" WHERE \"association\"='american music awards' AND \"category\"='favorite rap/hip-hop new artist';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 with a Leading scorer with maurice williams (25), and a Score with 102\u2013105?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"january\" WHERE \"leading_scorer\"='maurice williams (25)' AND \"score\"='102\u2013105';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 Score with a Home with hornets?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"january\" WHERE \"home\"='hornets';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 Score with a Visitor of bucks, and a Leading scorer with maurice williams (25)?" }, { "role": "assistant", "content": "SELECT \"score\" FROM \"january\" WHERE \"visitor\"='bucks' AND \"leading_scorer\"='maurice williams (25)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 Record with a Leading scorer with andrew bogut (29)?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"january\" WHERE \"leading_scorer\"='andrew bogut (29)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 Record with a Leading scorer with maurice williams (25), and a Date with 27 january 2008?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"january\" WHERE \"leading_scorer\"='maurice williams (25)' AND \"date\"='27 january 2008';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"january\" (\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 Record with a Score with 80\u201387, and a Visitor with bucks?" }, { "role": "assistant", "content": "SELECT \"record\" FROM \"january\" WHERE \"score\"='80\u201387' AND \"visitor\"='bucks';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"b\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What is the nationality of the player Tom Boswell?" }, { "role": "assistant", "content": "SELECT \"nationality\" FROM \"b\" WHERE \"player\"='tom boswell';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"b\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What is the nationality of the player from Duke?" }, { "role": "assistant", "content": "SELECT \"nationality\" FROM \"b\" WHERE \"school_club_team\"='duke';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"b\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What position did the player from Florida International play?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"b\" WHERE \"school_club_team\"='florida international';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"b\" (\n \"player\" text,\n \"nationality\" text,\n \"position\" text,\n \"years_for_jazz\" text,\n \"school_club_team\" text\n);\n\nQuestion: What is the nationality of the player from UCLA?" }, { "role": "assistant", "content": "SELECT \"nationality\" FROM \"b\" WHERE \"school_club_team\"='ucla';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"record_as_j_league_member\" (\n \"season\" real,\n \"div\" text,\n \"tms\" real,\n \"pos\" real,\n \"attendance_g\" real,\n \"emperor_s_cup\" text\n);\n\nQuestion: What was Attendance/G with Tms more than 18?" }, { "role": "assistant", "content": "SELECT AVG(\"attendance_g\") FROM \"record_as_j_league_member\" WHERE \"tms\">18;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"record_as_j_league_member\" (\n \"season\" real,\n \"div\" text,\n \"tms\" real,\n \"pos\" real,\n \"attendance_g\" real,\n \"emperor_s_cup\" text\n);\n\nQuestion: How many seasons did the Div J1 have the Emperor's cup in the 3rd round with Tms of more than 18?" }, { "role": "assistant", "content": "SELECT COUNT(\"season\") FROM \"record_as_j_league_member\" WHERE \"emperor_s_cup\"='3rd round' AND \"div\"='j1' AND \"tms\">18;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"teams_and_drivers\" (\n \"entrant\" text,\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyre\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: Which chassis had an entrant of John Mecom?" }, { "role": "assistant", "content": "SELECT \"chassis\" FROM \"teams_and_drivers\" WHERE \"entrant\"='john mecom';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"teams_and_drivers\" (\n \"entrant\" text,\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyre\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: What tyre was used for an entrant of Ecurie Nationale Suisse?" }, { "role": "assistant", "content": "SELECT \"tyre\" FROM \"teams_and_drivers\" WHERE \"entrant\"='ecurie nationale suisse';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"teams_and_drivers\" (\n \"entrant\" text,\n \"constructor\" text,\n \"chassis\" text,\n \"engine\" text,\n \"tyre\" text,\n \"driver\" text,\n \"rounds\" text\n);\n\nQuestion: Which rounds was Hap Sharp a driver in?" }, { "role": "assistant", "content": "SELECT \"rounds\" FROM \"teams_and_drivers\" WHERE \"driver\"='hap sharp';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the year when the title is jotei?" }, { "role": "assistant", "content": "SELECT SUM(\"year\") FROM \"drama\" WHERE \"title\"='jotei';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the original channel when the year is before 2006 and the note is supporting?" }, { "role": "assistant", "content": "SELECT \"original_channel\" FROM \"drama\" WHERE \"year\"<2006 AND \"note\"='supporting';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the original channel when the note is co-star in year 2012?" }, { "role": "assistant", "content": "SELECT \"original_channel\" FROM \"drama\" WHERE \"note\"='co-star' AND \"year\"=2012;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the original channel when the year is after 2012?" }, { "role": "assistant", "content": "SELECT \"original_channel\" FROM \"drama\" WHERE \"year\">2012;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the year when the note is supporting and the title is rokumeikan?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"drama\" WHERE \"note\"='supporting' AND \"title\"='rokumeikan';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"drama\" (\n \"year\" real,\n \"title\" text,\n \"original_channel\" text,\n \"role\" text,\n \"note\" text\n);\n\nQuestion: what is the title when the year is after 2011 and the original channel is nhk?" }, { "role": "assistant", "content": "SELECT \"title\" FROM \"drama\" WHERE \"year\">2011 AND \"original_channel\"='nhk';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: On which circuit does lorenzo bandini have the fastest lap as well as the pole position?" }, { "role": "assistant", "content": "SELECT \"circuit\" FROM \"season_review\" WHERE \"fastest_lap\"='lorenzo bandini' AND \"pole_position\"='lorenzo bandini';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: At what race does jim clark has a Pole position on the Circuit of monaco?" }, { "role": "assistant", "content": "SELECT \"race\" FROM \"season_review\" WHERE \"pole_position\"='jim clark' AND \"circuit\"='monaco';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: Which Report is on the Circuit of reims?" }, { "role": "assistant", "content": "SELECT \"report\" FROM \"season_review\" WHERE \"circuit\"='reims';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: On what Date is there a race on the Circuit of brands hatch?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"season_review\" WHERE \"circuit\"='brands hatch';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: Who is the Winnning driver in which lorenzo bandini has the fastest lap as well as the Pole position?" }, { "role": "assistant", "content": "SELECT \"winning_driver\" FROM \"season_review\" WHERE \"fastest_lap\"='lorenzo bandini' AND \"pole_position\"='lorenzo bandini';" } ]
[ { "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 \"circuit\" text,\n \"date\" text,\n \"pole_position\" text,\n \"fastest_lap\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"tyre\" text,\n \"report\" text\n);\n\nQuestion: On what date is there a Tryre of d at the Circuit of monaco?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"season_review\" WHERE \"tyre\"='d' AND \"circuit\"='monaco';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_17\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"against\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: What's the date that Morocco has an Against along with a surface of hard?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"singles_17\" WHERE \"against\"='morocco' AND \"surface\"='hard';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"singles_17\" (\n \"edition\" text,\n \"round\" text,\n \"date\" text,\n \"against\" text,\n \"surface\" text,\n \"opponent\" text,\n \"result\" text\n);\n\nQuestion: What's Round has a Surface of hard and Opponent of Jelena Simic?" }, { "role": "assistant", "content": "SELECT \"round\" FROM \"singles_17\" WHERE \"surface\"='hard' AND \"opponent\"='jelena simic';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"non_championship_race_results\" (\n \"race_name\" text,\n \"circuit\" text,\n \"date\" text,\n \"winning_driver\" text,\n \"constructor\" text,\n \"report\" text\n);\n\nQuestion: What driver won in the xv grand prix de l'albigeois in a vehicle by ferrari?" }, { "role": "assistant", "content": "SELECT \"winning_driver\" FROM \"non_championship_race_results\" WHERE \"constructor\"='ferrari' AND \"race_name\"='xv grand prix de l''albigeois';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lms_coaches\" (\n \"number_name\" text,\n \"description\" text,\n \"current_status\" text,\n \"livery\" text,\n \"date\" real\n);\n\nQuestion: What is the latest death with a description of BR-Built inspection saloon?" }, { "role": "assistant", "content": "SELECT MAX(\"date\") FROM \"lms_coaches\" WHERE \"description\"='br-built inspection saloon';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lms_coaches\" (\n \"number_name\" text,\n \"description\" text,\n \"current_status\" text,\n \"livery\" text,\n \"date\" real\n);\n\nQuestion: What is the identifying number for a description of Stanier (Period III) full brake?" }, { "role": "assistant", "content": "SELECT \"number_name\" FROM \"lms_coaches\" WHERE \"description\"='stanier (period iii) full brake';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"lms_coaches\" (\n \"number_name\" text,\n \"description\" text,\n \"current_status\" text,\n \"livery\" text,\n \"date\" real\n);\n\nQuestion: What is the date with identifying number of No. 37817?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"lms_coaches\" WHERE \"number_name\"='no. 37817';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"formats\" (\n \"release_format\" text,\n \"country\" text,\n \"label_s\" text,\n \"cat_no\" text,\n \"release_date\" text\n);\n\nQuestion: What is the release date for the standard cd release format in north america?" }, { "role": "assistant", "content": "SELECT \"release_date\" FROM \"formats\" WHERE \"release_format\"='standard cd' AND \"country\"='north america';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"formats\" (\n \"release_format\" text,\n \"country\" text,\n \"label_s\" text,\n \"cat_no\" text,\n \"release_date\" text\n);\n\nQuestion: What is the cat no for the label mute and the standard cd format?" }, { "role": "assistant", "content": "SELECT \"cat_no\" FROM \"formats\" WHERE \"label_s\"='mute' AND \"release_format\"='standard cd';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"weekly_ratings\" (\n \"episode\" text,\n \"air_date\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_m\" real,\n \"timeslot_rank\" real,\n \"night_rank\" text,\n \"overall_rank\" real\n);\n\nQuestion: What is the overall rank with rating smaller than 8.2 and rating share of 4.5/11?" }, { "role": "assistant", "content": "SELECT COUNT(\"overall_rank\") FROM \"weekly_ratings\" WHERE \"rating_share_18_49\"='4.5/11' AND \"rating\"<8.2;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"weekly_ratings\" (\n \"episode\" text,\n \"air_date\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_m\" real,\n \"timeslot_rank\" real,\n \"night_rank\" text,\n \"overall_rank\" real\n);\n\nQuestion: What is the rating for the episode with the night rank of 11 and timeslot rank is larger than 4?" }, { "role": "assistant", "content": "SELECT AVG(\"rating\") FROM \"weekly_ratings\" WHERE \"night_rank\"='11' AND \"timeslot_rank\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"weekly_ratings\" (\n \"episode\" text,\n \"air_date\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_m\" real,\n \"timeslot_rank\" real,\n \"night_rank\" text,\n \"overall_rank\" real\n);\n\nQuestion: What is the smallest share for a timeslot ranking less than 4 and fewer viewers than 8.78 million?" }, { "role": "assistant", "content": "SELECT MIN(\"share\") FROM \"weekly_ratings\" WHERE \"viewers_m\"<8.78 AND \"timeslot_rank\"<4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"weekly_ratings\" (\n \"episode\" text,\n \"air_date\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_m\" real,\n \"timeslot_rank\" real,\n \"night_rank\" text,\n \"overall_rank\" real\n);\n\nQuestion: What is the rating of the episode with 13.47 million viewers and overall rank larger than 6?" }, { "role": "assistant", "content": "SELECT SUM(\"rating\") FROM \"weekly_ratings\" WHERE \"viewers_m\"=13.47 AND \"overall_rank\">6;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"weekly_ratings\" (\n \"episode\" text,\n \"air_date\" text,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"viewers_m\" real,\n \"timeslot_rank\" real,\n \"night_rank\" text,\n \"overall_rank\" real\n);\n\nQuestion: What is the rank of the episode with a share of 6 and timeslot rank smaller than 4?" }, { "role": "assistant", "content": "SELECT AVG(\"overall_rank\") FROM \"weekly_ratings\" WHERE \"share\"=6 AND \"timeslot_rank\"<4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brisbane_based\" (\n \"club_team\" text,\n \"league\" text,\n \"venue\" text,\n \"established\" real,\n \"premierships\" text\n);\n\nQuestion: How many premierships for the queensland raceway?" }, { "role": "assistant", "content": "SELECT \"premierships\" FROM \"brisbane_based\" WHERE \"venue\"='queensland raceway';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"brisbane_based\" (\n \"club_team\" text,\n \"league\" text,\n \"venue\" text,\n \"established\" real,\n \"premierships\" text\n);\n\nQuestion: How many premierships for the commonwealth bank trophy league?" }, { "role": "assistant", "content": "SELECT \"premierships\" FROM \"brisbane_based\" WHERE \"league\"='commonwealth bank trophy';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: In which round was there a pick of 4?" }, { "role": "assistant", "content": "SELECT MAX(\"round\") FROM \"nfl_draft\" WHERE \"pick\"=4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: How many rounds were there an offensive tackle position?" }, { "role": "assistant", "content": "SELECT COUNT(\"round\") FROM \"nfl_draft\" WHERE \"position\"='offensive tackle';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"nfl_draft\" (\n \"pick\" real,\n \"round\" real,\n \"player\" text,\n \"position\" text,\n \"school\" text\n);\n\nQuestion: What was the pick number in round 228 for Mike Ford?" }, { "role": "assistant", "content": "SELECT MAX(\"pick\") FROM \"nfl_draft\" WHERE \"player\"='mike ford' AND \"round\">228;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What year was E. Meyer the driver?" }, { "role": "assistant", "content": "SELECT \"year\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"driver\"='e. meyer';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What is the name of the driver of the vehicle constructed by Bugatti in Anfa?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"constructor\"='bugatti' AND \"location\"='anfa';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What company constructed the vehicle in the location not held in 1933?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"location\"='not held' AND \"year\"='1933';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What company constructed the vehicle when the driver shows as not held?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"driver\"='not held';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What is the name of the driver in 1955?" }, { "role": "assistant", "content": "SELECT \"driver\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"year\"='1955';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"winners_of_the_moroccan_grand_prix\" (\n \"year\" text,\n \"driver\" text,\n \"constructor\" text,\n \"category\" text,\n \"location\" text,\n \"report\" text\n);\n\nQuestion: What is the name of the constructor when report shows report in 1955?" }, { "role": "assistant", "content": "SELECT \"constructor\" FROM \"winners_of_the_moroccan_grand_prix\" WHERE \"report\"='report' AND \"year\"='1955';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"engines_for_united_states_models\" (\n \"generation\" text,\n \"years\" text,\n \"engine\" text,\n \"power\" text,\n \"torque\" text,\n \"induction\" text\n);\n\nQuestion: What is the inductioin for 1975\u20131976?" }, { "role": "assistant", "content": "SELECT \"induction\" FROM \"engines_for_united_states_models\" WHERE \"years\"='1975\u20131976';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"engines_for_united_states_models\" (\n \"generation\" text,\n \"years\" text,\n \"engine\" text,\n \"power\" text,\n \"torque\" text,\n \"induction\" text\n);\n\nQuestion: What is the power of an engine of 1972?" }, { "role": "assistant", "content": "SELECT \"power\" FROM \"engines_for_united_states_models\" WHERE \"years\"='1972';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_3\" (\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: In the game where richmond was the away team, what venue was it played at?" }, { "role": "assistant", "content": "SELECT \"venue\" FROM \"round_3\" WHERE \"away_team\"='richmond';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_3\" (\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: On what date did the match where fitzroy was the home team occur?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_3\" 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 \"round_3\" (\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: In the match where the away team scored 12.16 (88), who was the home team?" }, { "role": "assistant", "content": "SELECT \"home_team_score\" FROM \"round_3\" WHERE \"away_team_score\"='12.16 (88)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_3\" (\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 was the name of the away team had a score of 17.15 (117)" }, { "role": "assistant", "content": "SELECT \"away_team\" FROM \"round_3\" WHERE \"away_team_score\"='17.15 (117)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_3\" (\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: On the match where the away team scored 16.16 (112) what was the crowd attendance?" }, { "role": "assistant", "content": "SELECT AVG(\"crowd\") FROM \"round_3\" WHERE \"away_team_score\"='16.16 (112)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"club_career_stats\" (\n \"season\" text,\n \"team\" text,\n \"country\" text,\n \"division\" real,\n \"apps\" real,\n \"goals\" real\n);\n\nQuestion: What is the smallest apps in Honduras with less than 2 goals for Club Deportivo Victoria in a division over 1?" }, { "role": "assistant", "content": "SELECT MIN(\"apps\") FROM \"club_career_stats\" WHERE \"country\"='honduras' AND \"goals\"<2 AND \"team\"='club deportivo victoria' AND \"division\">1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"race\" (\n \"driver\" text,\n \"constructor\" text,\n \"laps\" real,\n \"time_retired\" text,\n \"grid\" real\n);\n\nQuestion: What grid for jacques villeneuve with over 36 laps?" }, { "role": "assistant", "content": "SELECT MAX(\"grid\") FROM \"race\" WHERE \"driver\"='jacques villeneuve' AND \"laps\">36;" } ]
[ { "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 were the lowest laps of Tarso Marques?" }, { "role": "assistant", "content": "SELECT MIN(\"laps\") FROM \"race\" WHERE \"driver\"='tarso marques';" } ]
[ { "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's the average Grid for those who spun off after Lap 64?" }, { "role": "assistant", "content": "SELECT AVG(\"grid\") FROM \"race\" WHERE \"time_retired\"='spun off' AND \"laps\">64;" } ]
[ { "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 grid total that has a Time/Retired of + 1:33.141, and under 70 laps?" }, { "role": "assistant", "content": "SELECT SUM(\"grid\") FROM \"race\" WHERE \"time_retired\"='+ 1:33.141' AND \"laps\"<70;" } ]
[ { "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 high lap total for tyrrell - yamaha, and a Time/Retired of + 1 lap?" }, { "role": "assistant", "content": "SELECT MAX(\"laps\") FROM \"race\" WHERE \"constructor\"='tyrrell - yamaha' AND \"time_retired\"='+ 1 lap';" } ]
[ { "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 low lap total for a grid of 14?" }, { "role": "assistant", "content": "SELECT MIN(\"laps\") FROM \"race\" WHERE \"grid\"=14;" } ]
[ { "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: How many laps for martin brundle with a grid of less than 10?" }, { "role": "assistant", "content": "SELECT COUNT(\"laps\") FROM \"race\" WHERE \"driver\"='martin brundle' AND \"grid\"<10;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_and_cup_history\" (\n \"season\" text,\n \"level\" text,\n \"goals\" text,\n \"points\" real,\n \"domestic_cup\" text\n);\n\nQuestion: What was the average points in the quarterfinals domestic cup?" }, { "role": "assistant", "content": "SELECT AVG(\"points\") FROM \"league_and_cup_history\" WHERE \"domestic_cup\"='quarterfinals';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"league_and_cup_history\" (\n \"season\" text,\n \"level\" text,\n \"goals\" text,\n \"points\" real,\n \"domestic_cup\" text\n);\n\nQuestion: Which level is quarterfinals domestic cup?" }, { "role": "assistant", "content": "SELECT \"level\" FROM \"league_and_cup_history\" WHERE \"domestic_cup\"='quarterfinals';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: What format is catalogue 148615 in?" }, { "role": "assistant", "content": "SELECT \"format\" FROM \"release_history\" WHERE \"catalogue\"='148615';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: Which region was on June 8, 2004?" }, { "role": "assistant", "content": "SELECT \"region\" FROM \"release_history\" WHERE \"date\"='june 8, 2004';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: What format is catalogue WPCR13504 in?" }, { "role": "assistant", "content": "SELECT \"format\" FROM \"release_history\" WHERE \"catalogue\"='wpcr13504';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: What format is the Catalogue 9362486152 from the region of Australia in?" }, { "role": "assistant", "content": "SELECT \"format\" FROM \"release_history\" WHERE \"catalogue\"='9362486152' AND \"region\"='australia';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: What region is the catalogue number 9362486152 that was from September 3, 2004 from?" }, { "role": "assistant", "content": "SELECT \"region\" FROM \"release_history\" WHERE \"catalogue\"='9362486152' AND \"date\"='september 3, 2004';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"release_history\" (\n \"region\" text,\n \"date\" text,\n \"label\" text,\n \"format\" text,\n \"catalogue\" text\n);\n\nQuestion: What region is the catalogue released on June 8, 2004 from?" }, { "role": "assistant", "content": "SELECT \"region\" FROM \"release_history\" WHERE \"date\"='june 8, 2004';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_4\" (\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 day is carlton the home side?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_4\" 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_4\" (\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 away team's score when the Home team score is 14.18 (102)?" }, { "role": "assistant", "content": "SELECT \"away_team_score\" FROM \"round_4\" WHERE \"home_team_score\"='14.18 (102)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_4\" (\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's score when south melbourne is away?" }, { "role": "assistant", "content": "SELECT \"home_team_score\" FROM \"round_4\" WHERE \"away_team\"='south melbourne';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_4\" (\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 day does the home side score 13.13 (91)?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"round_4\" WHERE \"home_team_score\"='13.13 (91)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"superfund_sites\" (\n \"cerclis_id\" text,\n \"name\" text,\n \"county\" text,\n \"proposed\" text,\n \"listed\" text,\n \"construction_completed\" text,\n \"partially_deleted\" text,\n \"deleted\" text\n);\n\nQuestion: Tell me the listed when cerclis id is msd004006995" }, { "role": "assistant", "content": "SELECT \"listed\" FROM \"superfund_sites\" WHERE \"cerclis_id\"='msd004006995';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"the_biggest_loser_u_s_tv_series\" (\n \"episode\" real,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"rank_timeslot\" real,\n \"rank_night\" real\n);\n\nQuestion: What is the timeslor rank for the episode with larger than 2.9 rating, rating/share of 2.6/8 and rank for the night higher than 5?" }, { "role": "assistant", "content": "SELECT AVG(\"rank_timeslot\") FROM \"the_biggest_loser_u_s_tv_series\" WHERE \"rating\">2.9 AND \"rating_share_18_49\"='2.6/8' AND \"rank_night\">5;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"the_biggest_loser_u_s_tv_series\" (\n \"episode\" real,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"rank_timeslot\" real,\n \"rank_night\" real\n);\n\nQuestion: What is the smallest rating with nightly rank smaller than 7, timeslot rank smaller than 5 and eposide after episode 6?" }, { "role": "assistant", "content": "SELECT MIN(\"rating\") FROM \"the_biggest_loser_u_s_tv_series\" WHERE \"rank_night\"<7 AND \"rank_timeslot\"<5 AND \"episode\">6;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"the_biggest_loser_u_s_tv_series\" (\n \"episode\" real,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"rank_timeslot\" real,\n \"rank_night\" real\n);\n\nQuestion: What is the lowest nightly rank for an episode after episode 1 with a rating/share of 2.6/8?" }, { "role": "assistant", "content": "SELECT MIN(\"rank_night\") FROM \"the_biggest_loser_u_s_tv_series\" WHERE \"rating_share_18_49\"='2.6/8' AND \"episode\">1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"the_biggest_loser_u_s_tv_series\" (\n \"episode\" real,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"rank_timeslot\" real,\n \"rank_night\" real\n);\n\nQuestion: What is the timeslot rank when the rating is smaller than 2.6 and the share is more than 4?" }, { "role": "assistant", "content": "SELECT AVG(\"rank_timeslot\") FROM \"the_biggest_loser_u_s_tv_series\" WHERE \"rating\"<2.6 AND \"share\">4;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"the_biggest_loser_u_s_tv_series\" (\n \"episode\" real,\n \"rating\" real,\n \"share\" real,\n \"rating_share_18_49\" text,\n \"rank_timeslot\" real,\n \"rank_night\" real\n);\n\nQuestion: What is the smallest timeslot rank when the rating is smaller than 2.6?" }, { "role": "assistant", "content": "SELECT MIN(\"rank_timeslot\") FROM \"the_biggest_loser_u_s_tv_series\" WHERE \"rating\"<2.6;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_8\" (\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 away team played at Kardinia Park?" }, { "role": "assistant", "content": "SELECT \"away_team\" FROM \"round_8\" WHERE \"venue\"='kardinia park';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"round_8\" (\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 played Hawthorn?" }, { "role": "assistant", "content": "SELECT \"away_team\" FROM \"round_8\" WHERE \"home_team\"='hawthorn';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"final_standing\" (\n \"team\" text,\n \"games_played\" real,\n \"wins\" real,\n \"losses\" real,\n \"ties\" real,\n \"goals_for\" real,\n \"goals_against\" real\n);\n\nQuestion: What is the total wins with less than 21 goals taken?" }, { "role": "assistant", "content": "SELECT SUM(\"wins\") FROM \"final_standing\" WHERE \"goals_against\"<21;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"game_log\" (\n \"game\" real,\n \"date\" text,\n \"team\" text,\n \"score\" text,\n \"high_points\" text,\n \"high_rebounds\" text,\n \"high_assists\" text,\n \"location_attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the date of game 59?" }, { "role": "assistant", "content": "SELECT \"date\" FROM \"game_log\" WHERE \"game\"=59;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2007_rugby_world_cup_squads\" (\n \"player\" text,\n \"position\" text,\n \"date_of_birth_age\" text,\n \"caps\" real,\n \"club_province\" text\n);\n\nQuestion: What player is a lock with 1 cap?" }, { "role": "assistant", "content": "SELECT \"player\" FROM \"2007_rugby_world_cup_squads\" WHERE \"position\"='lock' AND \"caps\"=1;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2007_rugby_world_cup_squads\" (\n \"player\" text,\n \"position\" text,\n \"date_of_birth_age\" text,\n \"caps\" real,\n \"club_province\" text\n);\n\nQuestion: What position does ceri sweeney with under 87 caps of the newport gwent dragons play?" }, { "role": "assistant", "content": "SELECT \"position\" FROM \"2007_rugby_world_cup_squads\" WHERE \"club_province\"='newport gwent dragons' AND \"caps\"<87 AND \"player\"='ceri sweeney';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2007_rugby_world_cup_squads\" (\n \"player\" text,\n \"position\" text,\n \"date_of_birth_age\" text,\n \"caps\" real,\n \"club_province\" text\n);\n\nQuestion: What player has 12 caps?" }, { "role": "assistant", "content": "SELECT \"player\" FROM \"2007_rugby_world_cup_squads\" WHERE \"caps\"=12;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"block_a\" text,\n \"ryuji_hijikata\" text,\n \"shuji_kondo\" text,\n \"mazada\" text,\n \"el_samurai\" text\n);\n\nQuestion: Tell me the Shuji Kondo for MAZADA of X with Ryuji Hijikata of hijikata (14:24)" }, { "role": "assistant", "content": "SELECT \"shuji_kondo\" FROM \"2008\" WHERE \"mazada\"='x' AND \"ryuji_hijikata\"='hijikata (14:24)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"block_a\" text,\n \"ryuji_hijikata\" text,\n \"shuji_kondo\" text,\n \"mazada\" text,\n \"el_samurai\" text\n);\n\nQuestion: Name the El samurai with MAZADA of x for Ryuji Hijikata of draw (30:00)" }, { "role": "assistant", "content": "SELECT \"el_samurai\" FROM \"2008\" WHERE \"mazada\"='x' AND \"ryuji_hijikata\"='draw (30:00)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"block_a\" text,\n \"ryuji_hijikata\" text,\n \"shuji_kondo\" text,\n \"mazada\" text,\n \"el_samurai\" text\n);\n\nQuestion: Name the MAZADA for El Samurai of mazada (16:22)" }, { "role": "assistant", "content": "SELECT \"mazada\" FROM \"2008\" WHERE \"el_samurai\"='mazada (16:22)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"2008\" (\n \"block_a\" text,\n \"ryuji_hijikata\" text,\n \"shuji_kondo\" text,\n \"mazada\" text,\n \"el_samurai\" text\n);\n\nQuestion: Name the Shuji Kondo for MAZADA of hijikata (14:24)" }, { "role": "assistant", "content": "SELECT \"shuji_kondo\" FROM \"2008\" WHERE \"mazada\"='hijikata (14:24)';" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"br_railbuses\" (\n \"number_range\" text,\n \"builder\" text,\n \"introduced\" real,\n \"no_built\" real,\n \"region\" text,\n \"withdrawn\" real\n);\n\nQuestion: when was the building withdrawn when the builder was ac cars and was introduced before 1958?" }, { "role": "assistant", "content": "SELECT SUM(\"withdrawn\") FROM \"br_railbuses\" WHERE \"builder\"='ac cars' AND \"introduced\"<1958;" } ]
[ { "role": "system", "content": "You are an expert SQL query generator. Only output valid SQL." }, { "role": "user", "content": "### Database Schema\nCREATE TABLE \"october\" (\n \"date\" text,\n \"visitor\" text,\n \"score\" text,\n \"home\" text,\n \"decision\" text,\n \"attendance\" real,\n \"record\" text\n);\n\nQuestion: What was the decision on october 5?" }, { "role": "assistant", "content": "SELECT \"decision\" FROM \"october\" WHERE \"date\"='october 5';" } ]