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 \"recent_government_budget_balances\" (\n \"year\" real,\n \"income\" real,\n \"expenditure\" real,\n \"surplus_deficit\" text,\n \"pct_gdp\" text\n);\n\nQuestion: Which Year has an Expenditure of 55, and an Income smaller than 36.2?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"year\") FROM \"recent_government_budget_balances\" WHERE \"expenditure\"=55 AND \"income\"<36.2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"recent_government_budget_balances\" (\n \"year\" real,\n \"income\" real,\n \"expenditure\" real,\n \"surplus_deficit\" text,\n \"pct_gdp\" text\n);\n\nQuestion: Which % GDP has a Year smaller than 2011, and an Expenditure larger than 41.3, and an Income smaller than 48, and a Surplus(Deficit) of (24.6)?"
},
{
"role": "assistant",
"content": "SELECT \"pct_gdp\" FROM \"recent_government_budget_balances\" WHERE \"year\"<2011 AND \"expenditure\">41.3 AND \"income\"<48 AND \"surplus_deficit\"='(24.6)';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"year\" real,\n \"tournament_name\" text,\n \"champions\" text,\n \"runners_up\" text,\n \"score\" text\n);\n\nQuestion: What year was the Grand Prix Passing Shot Bordeaux that had Runners-up of Diego Nargiso?"
},
{
"role": "assistant",
"content": "SELECT \"year\" FROM \"singles\" WHERE \"tournament_name\"='grand prix passing shot bordeaux' AND \"runners_up\"='diego nargiso';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"year\" real,\n \"tournament_name\" text,\n \"champions\" text,\n \"runners_up\" text,\n \"score\" text\n);\n\nQuestion: What tournament had a score of 5\u20137, 6\u20134, 6\u20134?"
},
{
"role": "assistant",
"content": "SELECT \"tournament_name\" FROM \"singles\" WHERE \"score\"='5\u20137, 6\u20134, 6\u20134';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"year\" real,\n \"tournament_name\" text,\n \"champions\" text,\n \"runners_up\" text,\n \"score\" text\n);\n\nQuestion: After 1989, what was the score of the Grand Prix Passing Shot where the Runners-up were Jeff Tarango?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"singles\" WHERE \"year\">1989 AND \"tournament_name\"='grand prix passing shot' AND \"runners_up\"='jeff tarango';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"singles\" (\n \"year\" real,\n \"tournament_name\" text,\n \"champions\" text,\n \"runners_up\" text,\n \"score\" text\n);\n\nQuestion: What's the name of the tournament that Gianni Ocleppo was the runner-up?"
},
{
"role": "assistant",
"content": "SELECT \"tournament_name\" FROM \"singles\" WHERE \"runners_up\"='gianni ocleppo';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season_results\" (\n \"season\" text,\n \"wins\" real,\n \"losses\" real,\n \"winpct\" real,\n \"games_behind\" text,\n \"playoffs\" text,\n \"results\" text\n);\n\nQuestion: What is the lowest percentage of wins for 6\u00bd games and more than 77 total wins?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"winpct\") FROM \"regular_season_results\" WHERE \"games_behind\"='6\u00bd' AND \"wins\">77;"
}
] |
[
{
"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 \"attendance\" text,\n \"record\" text\n);\n\nQuestion: What is the score of the competition on November 10?"
},
{
"role": "assistant",
"content": "SELECT \"score\" FROM \"november\" WHERE \"date\"='november 10';"
}
] |
[
{
"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 \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who is the visitor when the record is 2-1?"
},
{
"role": "assistant",
"content": "SELECT \"visitor\" FROM \"november\" WHERE \"record\"='2-1';"
}
] |
[
{
"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 \"attendance\" text,\n \"record\" text\n);\n\nQuestion: Who is the home team when the score is 81-80?"
},
{
"role": "assistant",
"content": "SELECT \"home\" FROM \"november\" WHERE \"score\"='81-80';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"medal_table_unofficial\" (\n \"rank\" text,\n \"nation\" text,\n \"gold\" real,\n \"silver\" real,\n \"bronze\" real,\n \"total\" real\n);\n\nQuestion: How many Gold medals did Japan receive who had a Total of more than 1 medals?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"gold\") FROM \"medal_table_unofficial\" WHERE \"nation\"='japan' AND \"total\">1;"
}
] |
[
{
"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 \"time_cst\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"record\" text,\n \"nfl_recap\" text\n);\n\nQuestion: What time (cst) has and NFL recap of recap with october 19, 2008 as the date?"
},
{
"role": "assistant",
"content": "SELECT \"time_cst\" FROM \"schedule\" WHERE \"nfl_recap\"='recap' AND \"date\"='october 19, 2008';"
}
] |
[
{
"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 \"time_cst\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"record\" text,\n \"nfl_recap\" text\n);\n\nQuestion: Which week has giants stadium as the game site?"
},
{
"role": "assistant",
"content": "SELECT \"week\" FROM \"schedule\" WHERE \"game_site\"='giants stadium';"
}
] |
[
{
"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 \"time_cst\" text,\n \"opponent\" text,\n \"result\" text,\n \"game_site\" text,\n \"record\" text,\n \"nfl_recap\" text\n);\n\nQuestion: What is the lowest week that has 7:15 p.m. as the time (cst) and fedexfield as the game site?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"week\") FROM \"schedule\" WHERE \"time_cst\"='7:15 p.m.' AND \"game_site\"='fedexfield';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1934_state_election_results\" (\n \"office\" text,\n \"democratic_ticket\" text,\n \"republican_ticket\" text,\n \"socialist_ticket\" text,\n \"constitutional_ticket\" text,\n \"law_preservation_ticket\" text\n);\n\nQuestion: What office was law preservation ticket holder William E. Barron running for?"
},
{
"role": "assistant",
"content": "SELECT \"office\" FROM \"1934_state_election_results\" WHERE \"law_preservation_ticket\"='william e. barron';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1934_state_election_results\" (\n \"office\" text,\n \"democratic_ticket\" text,\n \"republican_ticket\" text,\n \"socialist_ticket\" text,\n \"constitutional_ticket\" text,\n \"law_preservation_ticket\" text\n);\n\nQuestion: Who was the constitutional ticken when Charles B. Sears was the republican ticket?"
},
{
"role": "assistant",
"content": "SELECT \"constitutional_ticket\" FROM \"1934_state_election_results\" WHERE \"republican_ticket\"='charles b. sears';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"1934_state_election_results\" (\n \"office\" text,\n \"democratic_ticket\" text,\n \"republican_ticket\" text,\n \"socialist_ticket\" text,\n \"constitutional_ticket\" text,\n \"law_preservation_ticket\" text\n);\n\nQuestion: Who was the constitutional ticket when william karlin was the socialist ticket?"
},
{
"role": "assistant",
"content": "SELECT \"constitutional_ticket\" FROM \"1934_state_election_results\" WHERE \"socialist_ticket\"='william karlin';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"pga_tour_wins_10\" (\n \"date\" text,\n \"tournament\" text,\n \"winning_score\" text,\n \"margin_of_victory\" text,\n \"runner_up\" text\n);\n\nQuestion: What was the margin of victory on Mar 18, 1979?"
},
{
"role": "assistant",
"content": "SELECT \"margin_of_victory\" FROM \"pga_tour_wins_10\" WHERE \"date\"='mar 18, 1979';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"year\" text,\n \"team\" text,\n \"comp\" text,\n \"rate\" text,\n \"r_att\" text,\n \"r_yds\" text,\n \"r_avg\" text\n);\n\nQuestion: What is the comp for the year 1989?"
},
{
"role": "assistant",
"content": "SELECT \"comp\" FROM \"regular_season\" WHERE \"year\"='1989';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"year\" text,\n \"team\" text,\n \"comp\" text,\n \"rate\" text,\n \"r_att\" text,\n \"r_yds\" text,\n \"r_avg\" text\n);\n\nQuestion: What is the team in 1989?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"regular_season\" WHERE \"year\"='1989';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"year\" text,\n \"team\" text,\n \"comp\" text,\n \"rate\" text,\n \"r_att\" text,\n \"r_yds\" text,\n \"r_avg\" text\n);\n\nQuestion: What is the RAtt in the year 1988?"
},
{
"role": "assistant",
"content": "SELECT \"r_att\" FROM \"regular_season\" WHERE \"year\"='1988';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"year\" text,\n \"team\" text,\n \"comp\" text,\n \"rate\" text,\n \"r_att\" text,\n \"r_yds\" text,\n \"r_avg\" text\n);\n\nQuestion: What was the team with a Ratt of 42?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"regular_season\" WHERE \"r_att\"='42';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"regular_season\" (\n \"year\" text,\n \"team\" text,\n \"comp\" text,\n \"rate\" text,\n \"r_att\" text,\n \"r_yds\" text,\n \"r_avg\" text\n);\n\nQuestion: What was the team with a ratt of 57?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"regular_season\" WHERE \"r_att\"='57';"
}
] |
[
{
"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 \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: Who did the Giants play before week 7 in Tulane Stadium?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"week\"<7 AND \"game_site\"='tulane stadium';"
}
] |
[
{
"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 \"game_site\" text,\n \"attendance\" real\n);\n\nQuestion: What was the lowest attendance for week 1?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"schedule\" WHERE \"week\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"player\" text,\n \"country\" text,\n \"goals\" real,\n \"years\" text\n);\n\nQuestion: What is the highest rank of a player from Ethiopia?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"country\"='ethiopia';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: How many ranks had 367 matches and more than 216 goals?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"matches\"=367 AND \"goals\">216;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"list_of_top_association_football_goal_sc\" (\n \"rank\" real,\n \"name\" text,\n \"years\" text,\n \"matches\" real,\n \"goals\" real\n);\n\nQuestion: What is the mean rank number when goals are 230 and there are more than 535?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"rank\") FROM \"list_of_top_association_football_goal_sc\" WHERE \"goals\"=230 AND \"matches\">535;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"viewing_figures\" (\n \"episode_number\" real,\n \"season\" text,\n \"original_airing\" text,\n \"total_viewers\" text,\n \"audience_share_average\" text,\n \"season_viewer_average\" text\n);\n\nQuestion: Where the audience share is 8%, what is the original airing?"
},
{
"role": "assistant",
"content": "SELECT \"original_airing\" FROM \"viewing_figures\" WHERE \"audience_share_average\"='8%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"viewing_figures\" (\n \"episode_number\" real,\n \"season\" text,\n \"original_airing\" text,\n \"total_viewers\" text,\n \"audience_share_average\" text,\n \"season_viewer_average\" text\n);\n\nQuestion: For episode number 2 what is the season viewer average?"
},
{
"role": "assistant",
"content": "SELECT \"season_viewer_average\" FROM \"viewing_figures\" WHERE \"episode_number\"=2;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"viewing_figures\" (\n \"episode_number\" real,\n \"season\" text,\n \"original_airing\" text,\n \"total_viewers\" text,\n \"audience_share_average\" text,\n \"season_viewer_average\" text\n);\n\nQuestion: What episode number has an audience share of 10%?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"episode_number\") FROM \"viewing_figures\" WHERE \"audience_share_average\"='10%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"peter_drummond_1911_1918\" (\n \"class\" text,\n \"wheels\" real,\n \"date\" text,\n \"builder\" text,\n \"no_built\" real,\n \"1919_nos\" text,\n \"lms_class\" text,\n \"lms_nos\" text\n);\n\nQuestion: What is the value for the item \"Class\" when the value of the item \"Wheels\" is 137?"
},
{
"role": "assistant",
"content": "SELECT \"class\" FROM \"peter_drummond_1911_1918\" WHERE \"wheels\"=137;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rebounds\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"rebounds\" real\n);\n\nQuestion: What's the smallest number of games for the fenerbah\u00e7e team?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"games\") FROM \"rebounds\" WHERE \"team\"='fenerbah\u00e7e';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rebounds\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"rebounds\" real\n);\n\nQuestion: What's the mean game number for the olympiacos team when there's less than 17 rebounds?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"games\") FROM \"rebounds\" WHERE \"team\"='olympiacos' AND \"rebounds\"<17;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"rebounds\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"rebounds\" real\n);\n\nQuestion: How many games does novica veli\u010dkovi\u0107 have when there's more than 24 rebounds?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"games\") FROM \"rebounds\" WHERE \"name\"='novica veli\u010dkovi\u0107' AND \"rebounds\">24;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"year_by_year_record\" (\n \"year\" text,\n \"league\" text,\n \"reg_season\" text,\n \"playoffs\" text,\n \"lost\" real\n);\n\nQuestion: What is the League with a Year that is 1990/91?"
},
{
"role": "assistant",
"content": "SELECT \"league\" FROM \"year_by_year_record\" WHERE \"year\"='1990/91';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"destinations\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What is the ICAO for simferopol international airport?"
},
{
"role": "assistant",
"content": "SELECT \"icao\" FROM \"destinations\" WHERE \"airport\"='simferopol international airport';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"destinations\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: Which country has an IATA of gzt?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"destinations\" WHERE \"iata\"='gzt';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"destinations\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What country is Yerevan located in?"
},
{
"role": "assistant",
"content": "SELECT \"country\" FROM \"destinations\" WHERE \"city\"='yerevan';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"destinations\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What is the ICAO when the IATA is ika?"
},
{
"role": "assistant",
"content": "SELECT \"icao\" FROM \"destinations\" WHERE \"iata\"='ika';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"destinations\" (\n \"city\" text,\n \"country\" text,\n \"iata\" text,\n \"icao\" text,\n \"airport\" text\n);\n\nQuestion: What is the ICAO when the IATA is ist?"
},
{
"role": "assistant",
"content": "SELECT \"icao\" FROM \"destinations\" WHERE \"iata\"='ist';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"first_league\" (\n \"team\" text,\n \"match\" real,\n \"points\" real,\n \"draw\" real,\n \"lost\" real\n);\n\nQuestion: Which team has 10 losses?"
},
{
"role": "assistant",
"content": "SELECT \"team\" FROM \"first_league\" WHERE \"lost\"=10;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: In which yearly change was there a capacity of 78.4% and a rank smaller than 3?"
},
{
"role": "assistant",
"content": "SELECT \"annual_change\" FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"rank\"<3 AND \"capacity_in_use\"='78.4%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: In Which rank was there a location of porto alegre?"
},
{
"role": "assistant",
"content": "SELECT \"rank\" FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"location\"='porto alegre';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: what is the number of passengers when the capacity is 81.2%?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"total_passengers\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"capacity_in_use\"='81.2%';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: what is the highest amount of passengers when there is a rank of 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"total_passengers\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"rank\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"brazil_s_15_busiest_airports_by_passenge\" (\n \"rank\" real,\n \"location\" text,\n \"total_passengers\" real,\n \"annual_change\" text,\n \"capacity_in_use\" text\n);\n\nQuestion: Which highest rank had an annual change of 10.3% and a capacity of people smaller than 1,368,968?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"brazil_s_15_busiest_airports_by_passenge\" WHERE \"annual_change\"='10.3%' AND \"total_passengers\"<'1,368,968';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"season_schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What was the latest Week on which the Result was l 17\u20130?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"week\") FROM \"season_schedule\" WHERE \"result\"='l 17\u20130';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average cuts made at the top 25, less than 10, and at the Top 10 more than 3?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"cuts_made\") FROM \"summary\" WHERE \"top_25\"<10 AND \"top_10\">3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is average Top 10 with 0 wins?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"top_10\") FROM \"summary\" WHERE \"wins\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average event for the Open Championship Tournament, and a Top-5 less than 1?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"events\") FROM \"summary\" WHERE \"tournament\"='the open championship' AND \"top_5\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"summary\" (\n \"tournament\" text,\n \"wins\" real,\n \"top_5\" real,\n \"top_10\" real,\n \"top_25\" real,\n \"events\" real,\n \"cuts_made\" real\n);\n\nQuestion: What is the average wins has Top-25 less than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"wins\") FROM \"summary\" WHERE \"top_25\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the largest Against with a Byes larger than 0?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"against\") FROM \"2012_ladder\" WHERE \"byes\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Wins has an Against of 1940, and a Byes larger than 0?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"wins\") FROM \"2012_ladder\" WHERE \"against\"=1940 AND \"byes\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Draws has a Wins of 10, and a Peel of south mandurah, and a Byes larger than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"draws\") FROM \"2012_ladder\" WHERE \"wins\"=10 AND \"peel\"='south mandurah' AND \"byes\">0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Against has a Draws larger than 0, a Losses smaller than 16, and a Wins smaller than 4?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"against\") FROM \"2012_ladder\" WHERE \"draws\">0 AND \"losses\"<16 AND \"wins\"<4;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Losses has an Against of 1101, and a Byes smaller than 0?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"losses\") FROM \"2012_ladder\" WHERE \"against\"=1101 AND \"byes\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2012_ladder\" (\n \"peel\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: Which Byes has a Losses smaller than 1?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"byes\") FROM \"2012_ladder\" WHERE \"losses\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: What is the average number of games of the player with a rank less than 1?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"games\") FROM \"points\" WHERE \"rank\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: What is the highest rank of the player with less than 32 points?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"rank\") FROM \"points\" WHERE \"points\"<32;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"points\" (\n \"rank\" real,\n \"name\" text,\n \"team\" text,\n \"games\" real,\n \"points\" real\n);\n\nQuestion: What is the rank of the player with less than 34 points?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"rank\") FROM \"points\" WHERE \"points\"<34;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's Fourth District has a Second District of bob springstead?"
},
{
"role": "assistant",
"content": "SELECT \"fourth_district\" FROM \"current_members\" WHERE \"second_district\"='bob springstead';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's the First District with a Fifth District of prudy adam?"
},
{
"role": "assistant",
"content": "SELECT \"first_district\" FROM \"current_members\" WHERE \"fifth_district\"='prudy adam';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's the Fourth District with a First District of beverly bodem?"
},
{
"role": "assistant",
"content": "SELECT \"fourth_district\" FROM \"current_members\" WHERE \"first_district\"='beverly bodem';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's the Fourth District with a Second District of kurt van koevering?"
},
{
"role": "assistant",
"content": "SELECT \"fourth_district\" FROM \"current_members\" WHERE \"second_district\"='kurt van koevering';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's the Fifth District with a Second District of paul leidig?"
},
{
"role": "assistant",
"content": "SELECT \"fifth_district\" FROM \"current_members\" WHERE \"second_district\"='paul leidig';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"current_members\" (\n \"first_district\" text,\n \"second_district\" text,\n \"third_district\" text,\n \"fourth_district\" text,\n \"fifth_district\" text\n);\n\nQuestion: Who's the Fourth District with a Third District of sharon yentsch?"
},
{
"role": "assistant",
"content": "SELECT \"fourth_district\" FROM \"current_members\" WHERE \"third_district\"='sharon yentsch';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"aces\" real,\n \"player\" text,\n \"opponent\" text,\n \"event\" text,\n \"sets\" real\n);\n\nQuestion: How many Sets did Gary Muller have?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"sets\") FROM \"men\" WHERE \"player\"='gary muller';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"aces\" real,\n \"player\" text,\n \"opponent\" text,\n \"event\" text,\n \"sets\" real\n);\n\nQuestion: What Player in 2005 Wimbledon had less than 5 Sets?"
},
{
"role": "assistant",
"content": "SELECT \"player\" FROM \"men\" WHERE \"sets\"<5 AND \"event\"='2005 wimbledon';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"men\" (\n \"aces\" real,\n \"player\" text,\n \"opponent\" text,\n \"event\" text,\n \"sets\" real\n);\n\nQuestion: At the 2001 Davis Cup, what Opponent had less than 50 Aces?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"men\" WHERE \"aces\"<50 AND \"event\"='2001 davis cup';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_kingdom\" (\n \"episode_number\" real,\n \"title\" text,\n \"original_airing_on_channel_4\" text,\n \"time_of_airing_on_channel_4\" text,\n \"original_airing_on_e4\" text,\n \"time_of_airing_on_e4\" text,\n \"position_in_channel_4_and_channel_4_1_s_ratings\" text,\n \"position_in_e4_and_e4_1_s_ratings\" text\n);\n\nQuestion: What is Channel 4 and Channel 4+1's rating in E4 and E4+1 when the ratings were 780,200?"
},
{
"role": "assistant",
"content": "SELECT \"position_in_channel_4_and_channel_4_1_s_ratings\" FROM \"united_kingdom\" WHERE \"position_in_e4_and_e4_1_s_ratings\"='780,200';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_kingdom\" (\n \"episode_number\" real,\n \"title\" text,\n \"original_airing_on_channel_4\" text,\n \"time_of_airing_on_channel_4\" text,\n \"original_airing_on_e4\" text,\n \"time_of_airing_on_e4\" text,\n \"position_in_channel_4_and_channel_4_1_s_ratings\" text,\n \"position_in_e4_and_e4_1_s_ratings\" text\n);\n\nQuestion: What time did Channel 4 air an episode number larger than 106 with the title of Marry Me A Little?"
},
{
"role": "assistant",
"content": "SELECT \"time_of_airing_on_channel_4\" FROM \"united_kingdom\" WHERE \"episode_number\">106 AND \"title\"='marry me a little';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"month_year\" text,\n \"sunk_by_u_boat\" real,\n \"sunk_by_aircraft\" real,\n \"sunk_by_warship_or_raider\" real,\n \"sunk_by_mines\" real,\n \"german_submarines_lost\" real\n);\n\nQuestion: What is the total number of sunk by U-boats with less than 2 German submarines lost, 56328 sunk by aircrafts, and more than 8269 sunk by mines?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"sunk_by_u_boat\") FROM \"references\" WHERE \"german_submarines_lost\"<2 AND \"sunk_by_aircraft\"=56328 AND \"sunk_by_mines\">8269;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"month_year\" text,\n \"sunk_by_u_boat\" real,\n \"sunk_by_aircraft\" real,\n \"sunk_by_warship_or_raider\" real,\n \"sunk_by_mines\" real,\n \"german_submarines_lost\" real\n);\n\nQuestion: What is the total number sunk by warship or raider with 20 German submarines lost and more than 21616 sunk by aircraft?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"sunk_by_warship_or_raider\") FROM \"references\" WHERE \"german_submarines_lost\"=20 AND \"sunk_by_aircraft\">21616;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"month_year\" text,\n \"sunk_by_u_boat\" real,\n \"sunk_by_aircraft\" real,\n \"sunk_by_warship_or_raider\" real,\n \"sunk_by_mines\" real,\n \"german_submarines_lost\" real\n);\n\nQuestion: What is the total number of German submarines lost with more than 120958 sunk by mines?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"german_submarines_lost\") FROM \"references\" WHERE \"sunk_by_mines\">120958;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"month_year\" text,\n \"sunk_by_u_boat\" real,\n \"sunk_by_aircraft\" real,\n \"sunk_by_warship_or_raider\" real,\n \"sunk_by_mines\" real,\n \"german_submarines_lost\" real\n);\n\nQuestion: What is the month and year less than 5 German submarines were lost, less than 6893 were sunk by warship or raider, less than 133746 were sunk by aircraft, and more than 111263 were sunk by U-boat?"
},
{
"role": "assistant",
"content": "SELECT \"month_year\" FROM \"references\" WHERE \"german_submarines_lost\"<5 AND \"sunk_by_warship_or_raider\"<6893 AND \"sunk_by_aircraft\"<133746 AND \"sunk_by_u_boat\">111263;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"references\" (\n \"month_year\" text,\n \"sunk_by_u_boat\" real,\n \"sunk_by_aircraft\" real,\n \"sunk_by_warship_or_raider\" real,\n \"sunk_by_mines\" real,\n \"german_submarines_lost\" real\n);\n\nQuestion: What is the month and year less than 106005 were sunk by aircraft and 61857 were sunk by warship or raider?"
},
{
"role": "assistant",
"content": "SELECT \"month_year\" FROM \"references\" WHERE \"sunk_by_aircraft\"<106005 AND \"sunk_by_warship_or_raider\"=61857;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"provinces_of_joseon\" (\n \"rr_romaja\" text,\n \"m_r_romaja\" text,\n \"hangul\" text,\n \"hanja\" text,\n \"name_origin\" text,\n \"capital\" text,\n \"region\" text,\n \"korean_dialect\" text,\n \"post_1896_provinces\" text\n);\n\nQuestion: What is the post-1986 provinces with a \u5168\u7f85\u9053 Hanja?"
},
{
"role": "assistant",
"content": "SELECT \"post_1896_provinces\" FROM \"provinces_of_joseon\" WHERE \"hanja\"='\u5168\u7f85\u9053';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"provinces_of_joseon\" (\n \"rr_romaja\" text,\n \"m_r_romaja\" text,\n \"hangul\" text,\n \"hanja\" text,\n \"name_origin\" text,\n \"capital\" text,\n \"region\" text,\n \"korean_dialect\" text,\n \"post_1896_provinces\" text\n);\n\nQuestion: What is the Korean dialect in the daegu capital?"
},
{
"role": "assistant",
"content": "SELECT \"korean_dialect\" FROM \"provinces_of_joseon\" WHERE \"capital\"='daegu';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"provinces_of_joseon\" (\n \"rr_romaja\" text,\n \"m_r_romaja\" text,\n \"hangul\" text,\n \"hanja\" text,\n \"name_origin\" text,\n \"capital\" text,\n \"region\" text,\n \"korean_dialect\" text,\n \"post_1896_provinces\" text\n);\n\nQuestion: What is the Korean dialect with a jeolla RR Romaja?"
},
{
"role": "assistant",
"content": "SELECT \"korean_dialect\" FROM \"provinces_of_joseon\" WHERE \"rr_romaja\"='jeolla';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"provinces_of_joseon\" (\n \"rr_romaja\" text,\n \"m_r_romaja\" text,\n \"hangul\" text,\n \"hanja\" text,\n \"name_origin\" text,\n \"capital\" text,\n \"region\" text,\n \"korean_dialect\" text,\n \"post_1896_provinces\" text\n);\n\nQuestion: What is the Hanja for the hamgyeong RR Romaja?"
},
{
"role": "assistant",
"content": "SELECT \"hanja\" FROM \"provinces_of_joseon\" WHERE \"rr_romaja\"='hamgyeong';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_states\" (\n \"name\" text,\n \"level\" real,\n \"digits\" real,\n \"average_size_square_miles\" text,\n \"number_of_h_us_approximate\" real,\n \"example_name\" text,\n \"example_code_huc\" real\n);\n\nQuestion: What is the mean huc example code when the example name's lower snake, there are 6 digits, and less than 3 levels?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"example_code_huc\") FROM \"united_states\" WHERE \"example_name\"='lower snake' AND \"digits\"=6 AND \"level\"<3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_states\" (\n \"name\" text,\n \"level\" real,\n \"digits\" real,\n \"average_size_square_miles\" text,\n \"number_of_h_us_approximate\" real,\n \"example_name\" text,\n \"example_code_huc\" real\n);\n\nQuestion: What's the approximate number of HUs when there are more than 2 digits, and 6 levels?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"number_of_h_us_approximate\") FROM \"united_states\" WHERE \"digits\">2 AND \"level\"=6;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_states\" (\n \"name\" text,\n \"level\" real,\n \"digits\" real,\n \"average_size_square_miles\" text,\n \"number_of_h_us_approximate\" real,\n \"example_name\" text,\n \"example_code_huc\" real\n);\n\nQuestion: How many HUC example codes have 1 level?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"example_code_huc\") FROM \"united_states\" WHERE \"level\"=1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"united_states\" (\n \"name\" text,\n \"level\" real,\n \"digits\" real,\n \"average_size_square_miles\" text,\n \"number_of_h_us_approximate\" real,\n \"example_name\" text,\n \"example_code_huc\" real\n);\n\nQuestion: What is the mean level number when the example name is lower snake and the approximate number is hus is less than 370?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"level\") FROM \"united_states\" WHERE \"example_name\"='lower snake' AND \"number_of_h_us_approximate\"<370;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the losses average when the against is greater than 1255 and wins is 0 and the draws less than 0?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"losses\") FROM \"2004_ladder\" WHERE \"against\">1255 AND \"wins\"=0 AND \"draws\"<0;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the smallest losses when the wins are 5 and the against less than 1852?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"losses\") FROM \"2004_ladder\" WHERE \"wins\"=5 AND \"against\"<1852;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the total against that has wins less than 9, and losses less than 16, and 2 as the byes, and Ballarat FL of ballarat?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"against\") FROM \"2004_ladder\" WHERE \"wins\"<9 AND \"losses\"<16 AND \"byes\"=2 AND \"ballarat_fl\"='ballarat';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the fewest losses that Ballarat FL of Lake Wendouree has when the wins are smaller than 9?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"losses\") FROM \"2004_ladder\" WHERE \"ballarat_fl\"='lake wendouree' AND \"wins\"<9;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"2004_ladder\" (\n \"ballarat_fl\" text,\n \"wins\" real,\n \"byes\" real,\n \"losses\" real,\n \"draws\" real,\n \"against\" real\n);\n\nQuestion: What is the smallest byes when the wins are 3?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"byes\") FROM \"2004_ladder\" WHERE \"wins\"=3;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"stations\" (\n \"station\" text,\n \"year_opened\" text,\n \"metropolitan_borough_c\" text,\n \"zone\" real,\n \"station_users_2006_07\" real,\n \"station_users_2007_08\" real\n);\n\nQuestion: Can you tell me the total number of Zone than has the Station users 2007-08 larger than 243,800, and the Year opened of 1855?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"zone\") FROM \"stations\" WHERE \"station_users_2007_08\">'243,800' AND \"year_opened\"='1855';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"attendance\" real\n);\n\nQuestion: What is the highest Attendance when the away team was Wrexham?"
},
{
"role": "assistant",
"content": "SELECT MAX(\"attendance\") FROM \"second_round_proper\" WHERE \"away_team\"='wrexham';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"attendance\" real\n);\n\nQuestion: What is the Away team when the home team was wycombe wanderers?"
},
{
"role": "assistant",
"content": "SELECT \"away_team\" FROM \"second_round_proper\" WHERE \"home_team\"='wycombe wanderers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"attendance\" real\n);\n\nQuestion: What is the lowest Attendance when the home team was slough town?"
},
{
"role": "assistant",
"content": "SELECT MIN(\"attendance\") FROM \"second_round_proper\" WHERE \"home_team\"='slough town';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"second_round_proper\" (\n \"tie_no\" text,\n \"home_team\" text,\n \"score\" text,\n \"away_team\" text,\n \"attendance\" real\n);\n\nQuestion: What is the sum of Attendance when macclesfield town was the way team?"
},
{
"role": "assistant",
"content": "SELECT SUM(\"attendance\") FROM \"second_round_proper\" WHERE \"away_team\"='macclesfield town';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"radio_singles\" (\n \"single\" text,\n \"ccm_chart\" text,\n \"debut\" text,\n \"peak_date\" text,\n \"peak_pos\" real,\n \"total_wks\" real,\n \"spins_since_1998_source_mediabase\" real\n);\n\nQuestion: How many Spins sources have a CCM Chart of CHR with a peak position less than 1?"
},
{
"role": "assistant",
"content": "SELECT COUNT(\"spins_since_1998_source_mediabase\") FROM \"radio_singles\" WHERE \"ccm_chart\"='chr' AND \"peak_pos\"<1;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"radio_singles\" (\n \"single\" text,\n \"ccm_chart\" text,\n \"debut\" text,\n \"peak_date\" text,\n \"peak_pos\" real,\n \"total_wks\" real,\n \"spins_since_1998_source_mediabase\" real\n);\n\nQuestion: What CCM Chart had 18 total weeks?"
},
{
"role": "assistant",
"content": "SELECT \"ccm_chart\" FROM \"radio_singles\" WHERE \"total_wks\"=18;"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What is Opponent, when Date is December 18, 1988?"
},
{
"role": "assistant",
"content": "SELECT \"opponent\" FROM \"schedule\" WHERE \"date\"='december 18, 1988';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What is Attendance, when Opponent is Pittsburgh Steelers?"
},
{
"role": "assistant",
"content": "SELECT \"attendance\" FROM \"schedule\" WHERE \"opponent\"='pittsburgh steelers';"
}
] |
[
{
"role": "system",
"content": "You are an expert SQL query generator. Only output valid SQL."
},
{
"role": "user",
"content": "### Database Schema\nCREATE TABLE \"schedule\" (\n \"week\" real,\n \"date\" text,\n \"opponent\" text,\n \"result\" text,\n \"attendance\" real\n);\n\nQuestion: What is the average Week, when Result is l 37\u201334?"
},
{
"role": "assistant",
"content": "SELECT AVG(\"week\") FROM \"schedule\" WHERE \"result\"='l 37\u201334';"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.