output
stringlengths
27
479
instruction
stringlengths
407
1.39k
SELECT AVG("goals_for") FROM "final_table" WHERE "goal_difference"<-16 AND "club"='real oviedo' AND "wins"<9;
## Task Generate a SQL query to answer the following question: `What was the average number of "goals for", scored in the club Real Oviedo that had a "goal difference" lower than -16 and fewer than 9 wins?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "final_table" ( "position" real, "club" text, "played" real, "points" text, "wins" real, "draws" real, "losses" real, "goals_for" real, "goals_against" real, "goal_difference" real ); ### SQL Given the database schema, here is the SQL query that answers `What was the average number of "goals for", scored in the club Real Oviedo that had a "goal difference" lower than -16 and fewer than 9 wins?`: ```sql
SELECT SUM("played") FROM "final_table" WHERE "goal_difference"=-8 AND "position"<12;
## Task Generate a SQL query to answer the following question: `How many people played at the club that had a "goal difference" of -8 and a position lower than 12?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "final_table" ( "position" real, "club" text, "played" real, "points" text, "wins" real, "draws" real, "losses" real, "goals_for" real, "goals_against" real, "goal_difference" real ); ### SQL Given the database schema, here is the SQL query that answers `How many people played at the club that had a "goal difference" of -8 and a position lower than 12?`: ```sql
SELECT COUNT("goals_against") FROM "final_table" WHERE "goal_difference"=0 AND "wins"=12 AND "goals_for">44;
## Task Generate a SQL query to answer the following question: `How many "goals against" were scored at the club that had a "goal difference" of 0, 12 wins, and more than 44 goals?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "final_table" ( "position" real, "club" text, "played" real, "points" text, "wins" real, "draws" real, "losses" real, "goals_for" real, "goals_against" real, "goal_difference" real ); ### SQL Given the database schema, here is the SQL query that answers `How many "goals against" were scored at the club that had a "goal difference" of 0, 12 wins, and more than 44 goals?`: ```sql
SELECT MIN("goals_for") FROM "final_table" WHERE "wins"=18 AND "goals_against"<38;
## Task Generate a SQL query to answer the following question: `What is the smallest number of "goals for" out of the clubs where there were 18 wins and fewer than 38 "goals against"?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "final_table" ( "position" real, "club" text, "played" real, "points" text, "wins" real, "draws" real, "losses" real, "goals_for" real, "goals_against" real, "goal_difference" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the smallest number of "goals for" out of the clubs where there were 18 wins and fewer than 38 "goals against"?`: ```sql
SELECT MIN("year") FROM "list_of_winners" WHERE "fighter"='manny pacquiao';
## Task Generate a SQL query to answer the following question: `When did Manny Pacquiao win his first championship?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list_of_winners" ( "year" real, "fighter" text, "nation_represented" text, "sport" text, "sanctioning_body_or_league" text, "weight_class_represented_or_contested" text ); ### SQL Given the database schema, here is the SQL query that answers `When did Manny Pacquiao win his first championship?`: ```sql
SELECT "sport" FROM "list_of_winners" WHERE "nation_represented"='united states';
## Task Generate a SQL query to answer the following question: `Which sport did the United States win?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list_of_winners" ( "year" real, "fighter" text, "nation_represented" text, "sport" text, "sanctioning_body_or_league" text, "weight_class_represented_or_contested" text ); ### SQL Given the database schema, here is the SQL query that answers `Which sport did the United States win?`: ```sql
SELECT MAX("year") FROM "list_of_winners" WHERE "nation_represented"='philippines';
## Task Generate a SQL query to answer the following question: `What is the latest result where a person from the Philippines won?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list_of_winners" ( "year" real, "fighter" text, "nation_represented" text, "sport" text, "sanctioning_body_or_league" text, "weight_class_represented_or_contested" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the latest result where a person from the Philippines won?`: ```sql
SELECT "nation_represented" FROM "list_of_winners" WHERE "year"=2012;
## Task Generate a SQL query to answer the following question: `Which nation won the boxing championship in 2012?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list_of_winners" ( "year" real, "fighter" text, "nation_represented" text, "sport" text, "sanctioning_body_or_league" text, "weight_class_represented_or_contested" text ); ### SQL Given the database schema, here is the SQL query that answers `Which nation won the boxing championship in 2012?`: ```sql
SELECT "total_seats" FROM "results" WHERE "party"='christian democratic union (cdu)';
## Task Generate a SQL query to answer the following question: `What is the total number of seats of the Christian Democratic Union (CDU) party?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results" ( "party" text, "party_list_votes" real, "vote_percentage" text, "total_seats" text, "seat_percentage" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the total number of seats of the Christian Democratic Union (CDU) party?`: ```sql
SELECT "seat_percentage" FROM "results" WHERE "vote_percentage"='100.0%';
## Task Generate a SQL query to answer the following question: `What seat has a vote percentage of 100.0%` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results" ( "party" text, "party_list_votes" real, "vote_percentage" text, "total_seats" text, "seat_percentage" text ); ### SQL Given the database schema, here is the SQL query that answers `What seat has a vote percentage of 100.0%`: ```sql
SELECT AVG("area_km") FROM "list" WHERE "name"='glenella' AND "population_2011"<522;
## Task Generate a SQL query to answer the following question: `What was the area in Glenella with a population of 522 in 2011?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list" ( "name" text, "population_2011" real, "population_2006" real, "change_pct" real, "area_km" real, "population_density" real ); ### SQL Given the database schema, here is the SQL query that answers `What was the area in Glenella with a population of 522 in 2011?`: ```sql
SELECT COUNT("population_density") FROM "list" WHERE "name"='siglunes' AND "change_pct"<-8.1;
## Task Generate a SQL query to answer the following question: `What is the population density of Siglunes when the change was smaller than -8.1 percent?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list" ( "name" text, "population_2011" real, "population_2006" real, "change_pct" real, "area_km" real, "population_density" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the population density of Siglunes when the change was smaller than -8.1 percent?`: ```sql
SELECT "trainer" FROM "winners_of_the_virginia_derby_since_1998" WHERE "winner"='crowd pleaser';
## Task Generate a SQL query to answer the following question: `Who was the trainer when Crowd Pleaser won?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "winners_of_the_virginia_derby_since_1998" ( "year" real, "winner" text, "jockey" text, "trainer" text, "owner" text, "distance_miles" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the trainer when Crowd Pleaser won?`: ```sql
SELECT "time" FROM "winners_of_the_virginia_derby_since_1998" WHERE "jockey"='ramon dominguez';
## Task Generate a SQL query to answer the following question: `What was the race time of the horse with jockey Ramon Dominguez?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "winners_of_the_virginia_derby_since_1998" ( "year" real, "winner" text, "jockey" text, "trainer" text, "owner" text, "distance_miles" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the race time of the horse with jockey Ramon Dominguez?`: ```sql
SELECT "jockey" FROM "winners_of_the_virginia_derby_since_1998" WHERE "year"<2012 AND "owner"='michael house';
## Task Generate a SQL query to answer the following question: `What jockey rode for Michael House before 2012` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "winners_of_the_virginia_derby_since_1998" ( "year" real, "winner" text, "jockey" text, "trainer" text, "owner" text, "distance_miles" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `What jockey rode for Michael House before 2012`: ```sql
SELECT "events_won_uk_series" FROM "contestants" WHERE "events_won_us_series"<1;
## Task Generate a SQL query to answer the following question: `How many UK events won for the contestant that won under 1 US event?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "contestants" ( "name" text, "from" text, "discipline" text, "events_won_uk_series" real, "events_won_us_series" real ); ### SQL Given the database schema, here is the SQL query that answers `How many UK events won for the contestant that won under 1 US event?`: ```sql
SELECT AVG("events_won_us_series") FROM "contestants" WHERE "name"='jason bennett';
## Task Generate a SQL query to answer the following question: `How many US events did jason bennett win?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "contestants" ( "name" text, "from" text, "discipline" text, "events_won_uk_series" real, "events_won_us_series" real ); ### SQL Given the database schema, here is the SQL query that answers `How many US events did jason bennett win?`: ```sql
SELECT "downhill" FROM "season_standings" WHERE "overall"='7';
## Task Generate a SQL query to answer the following question: `Which downhill has 7 overalls?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_standings" ( "season" real, "overall" text, "slalom" text, "giant_slalom" text, "super_g" text, "downhill" text, "combined" text ); ### SQL Given the database schema, here is the SQL query that answers `Which downhill has 7 overalls?`: ```sql
SELECT "super_g" FROM "season_standings" WHERE "season"<1998 AND "giant_slalom"='2' AND "downhill"='24';
## Task Generate a SQL query to answer the following question: `What super g was before 1998, had 2 giant slaloms and 24 downhills?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_standings" ( "season" real, "overall" text, "slalom" text, "giant_slalom" text, "super_g" text, "downhill" text, "combined" text ); ### SQL Given the database schema, here is the SQL query that answers `What super g was before 1998, had 2 giant slaloms and 24 downhills?`: ```sql
SELECT "combined" FROM "season_standings" WHERE "overall"='2' AND "slalom"='5';
## Task Generate a SQL query to answer the following question: `What is the combined of 2 overalls and 5 slaloms?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_standings" ( "season" real, "overall" text, "slalom" text, "giant_slalom" text, "super_g" text, "downhill" text, "combined" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the combined of 2 overalls and 5 slaloms?`: ```sql
SELECT "overall" FROM "season_standings" WHERE "combined"='1' AND "downhill"='24';
## Task Generate a SQL query to answer the following question: `How many overalls has 1 combined and 24 downhills?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_standings" ( "season" real, "overall" text, "slalom" text, "giant_slalom" text, "super_g" text, "downhill" text, "combined" text ); ### SQL Given the database schema, here is the SQL query that answers `How many overalls has 1 combined and 24 downhills?`: ```sql
SELECT "distance" FROM "stage_results" WHERE "race_leader"='km (mi)';
## Task Generate a SQL query to answer the following question: `What Distance had a Race Leader in Km (mi)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "stage_results" ( "date" text, "course" text, "distance" text, "winner" text, "race_leader" text ); ### SQL Given the database schema, here is the SQL query that answers `What Distance had a Race Leader in Km (mi)?`: ```sql
SELECT MAX("points") FROM "season_by_season_record" WHERE "tied"='4' AND "goals_for"<257 AND "games">72;
## Task Generate a SQL query to answer the following question: `What is the highest number of points scored when Acadie-Bathurst had 4 tied games, less than 257 goals, and over 72 games played?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_by_season_record" ( "season" text, "games" real, "lost" real, "tied" text, "points" real, "goals_for" real, "goals_against" real, "standing" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the highest number of points scored when Acadie-Bathurst had 4 tied games, less than 257 goals, and over 72 games played?`: ```sql
SELECT AVG("played") FROM "rugby_wales_internationals_1987" WHERE "percentage"='3.33%' AND "lost"<29;
## Task Generate a SQL query to answer the following question: `What is the average of games played with a percentage of 3.33% and less than 29 losses?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "rugby_wales_internationals_1987" ( "first_game" real, "played" real, "drawn" real, "lost" real, "percentage" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the average of games played with a percentage of 3.33% and less than 29 losses?`: ```sql
SELECT COUNT("played") FROM "rugby_wales_internationals_1987" WHERE "first_game"=1991 AND "percentage"='22.22%' AND "lost">7;
## Task Generate a SQL query to answer the following question: `What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "rugby_wales_internationals_1987" ( "first_game" real, "played" real, "drawn" real, "lost" real, "percentage" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the total number of games played that correlates with a first game in 1991, a percentage of 22.22%, and less than 7 losses?`: ```sql
SELECT MAX("drawn") FROM "rugby_wales_internationals_1987" WHERE "percentage"='0.00%' AND "lost"<1;
## Task Generate a SQL query to answer the following question: `What is the highest number of draws that correlates with a percentage of 0.00% and less than 1 loss?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "rugby_wales_internationals_1987" ( "first_game" real, "played" real, "drawn" real, "lost" real, "percentage" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the highest number of draws that correlates with a percentage of 0.00% and less than 1 loss?`: ```sql
SELECT "start" FROM "indy_500_results" WHERE "rank"='11';
## Task Generate a SQL query to answer the following question: `What is the start value for rank 11?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "indy_500_results" ( "year" text, "start" text, "qual" text, "rank" text, "finish" text, "laps" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the start value for rank 11?`: ```sql
SELECT "year" FROM "indy_500_results" WHERE "laps"=200;
## Task Generate a SQL query to answer the following question: `Which year has 200 laps?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "indy_500_results" ( "year" text, "start" text, "qual" text, "rank" text, "finish" text, "laps" real ); ### SQL Given the database schema, here is the SQL query that answers `Which year has 200 laps?`: ```sql
SELECT "finish" FROM "indy_500_results" WHERE "start"='19';
## Task Generate a SQL query to answer the following question: `What is the finish value for a start of 19?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "indy_500_results" ( "year" text, "start" text, "qual" text, "rank" text, "finish" text, "laps" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the finish value for a start of 19?`: ```sql
SELECT "country" FROM "2000s" WHERE "director"='alfonso cuarón';
## Task Generate a SQL query to answer the following question: `What country is the film directed by Alfonso Cuarón from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "2000s" ( "year" real, "english_title" text, "original_title" text, "country" text, "director" text ); ### SQL Given the database schema, here is the SQL query that answers `What country is the film directed by Alfonso Cuarón from?`: ```sql
SELECT "original_title" FROM "2000s" WHERE "director"='cristian mungiu';
## Task Generate a SQL query to answer the following question: `What is the original title of the film directed by Cristian Mungiu?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "2000s" ( "year" real, "english_title" text, "original_title" text, "country" text, "director" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the original title of the film directed by Cristian Mungiu?`: ```sql
SELECT "country" FROM "2000s" WHERE "director"='michael haneke';
## Task Generate a SQL query to answer the following question: `What country is the film directed by Michael Haneke from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "2000s" ( "year" real, "english_title" text, "original_title" text, "country" text, "director" text ); ### SQL Given the database schema, here is the SQL query that answers `What country is the film directed by Michael Haneke from?`: ```sql
SELECT "english_title" FROM "2000s" WHERE "year">2003 AND "director"='michael haneke';
## Task Generate a SQL query to answer the following question: `What is the English title of the film from after 2003 directed by Michael Haneke?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "2000s" ( "year" real, "english_title" text, "original_title" text, "country" text, "director" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the English title of the film from after 2003 directed by Michael Haneke?`: ```sql
SELECT "city" FROM "teams" WHERE "stadium"='naghsh jahan';
## Task Generate a SQL query to answer the following question: `where is the naghsh jahan stadium?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "teams" ( "team" text, "city" text, "stadium" text, "manager" text, "past_season" text ); ### SQL Given the database schema, here is the SQL query that answers `where is the naghsh jahan stadium?`: ```sql
SELECT "city" FROM "teams" WHERE "past_season"='n/a';
## Task Generate a SQL query to answer the following question: `what city has a past season of n/a?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "teams" ( "team" text, "city" text, "stadium" text, "manager" text, "past_season" text ); ### SQL Given the database schema, here is the SQL query that answers `what city has a past season of n/a?`: ```sql
SELECT "city" FROM "teams" WHERE "team"='pegah';
## Task Generate a SQL query to answer the following question: `where is the pegah team located?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "teams" ( "team" text, "city" text, "stadium" text, "manager" text, "past_season" text ); ### SQL Given the database schema, here is the SQL query that answers `where is the pegah team located?`: ```sql
SELECT "stadium" FROM "teams" WHERE "past_season"='7th';
## Task Generate a SQL query to answer the following question: `what stadium has a prior record of 7th?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "teams" ( "team" text, "city" text, "stadium" text, "manager" text, "past_season" text ); ### SQL Given the database schema, here is the SQL query that answers `what stadium has a prior record of 7th?`: ```sql
SELECT "nationality" FROM "heats" WHERE "lane"=4 AND "time"='1:11.58';
## Task Generate a SQL query to answer the following question: `What is the Nationality on the swimmer in Lane 4 with a Time of 1:11.58?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "heats" ( "heat" real, "lane" real, "name" text, "nationality" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the Nationality on the swimmer in Lane 4 with a Time of 1:11.58?`: ```sql
SELECT MIN("lane") FROM "heats" WHERE "heat">2 AND "time"='1:10.57';
## Task Generate a SQL query to answer the following question: `What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "heats" ( "heat" real, "lane" real, "name" text, "nationality" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the lowest numbered Lane with a Time of 1:10.57 and Heat larger than 2?`: ```sql
SELECT COUNT("heat") FROM "heats" WHERE "name"='smiljana marinović';
## Task Generate a SQL query to answer the following question: `What is the Heat for Smiljana Marinović?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "heats" ( "heat" real, "lane" real, "name" text, "nationality" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the Heat for Smiljana Marinović?`: ```sql
SELECT "nationality" FROM "heats" WHERE "heat"=4 AND "name"='byun hye-young';
## Task Generate a SQL query to answer the following question: `In heat 4, what is Byun Hye-young's Nationality?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "heats" ( "heat" real, "lane" real, "name" text, "nationality" text, "time" text ); ### SQL Given the database schema, here is the SQL query that answers `In heat 4, what is Byun Hye-young's Nationality?`: ```sql
SELECT "kind_of_the_song" FROM "songs" WHERE "singer"='miriam yeung';
## Task Generate a SQL query to answer the following question: `Which type of song did miriam yeung sing?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "songs" ( "number" real, "name_of_the_song" text, "singer" text, "drama" text, "kind_of_the_song" text ); ### SQL Given the database schema, here is the SQL query that answers `Which type of song did miriam yeung sing?`: ```sql
SELECT "kind_of_the_song" FROM "songs" WHERE "number">8 AND "name_of_the_song"='實情';
## Task Generate a SQL query to answer the following question: `What type of song is larger than 8 and named 實情?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "songs" ( "number" real, "name_of_the_song" text, "singer" text, "drama" text, "kind_of_the_song" text ); ### SQL Given the database schema, here is the SQL query that answers `What type of song is larger than 8 and named 實情?`: ```sql
SELECT "name_of_the_song" FROM "songs" WHERE "kind_of_the_song"='ending theme' AND "singer"='miriam yeung';
## Task Generate a SQL query to answer the following question: `Which song has a ending theme, and is sung by miriam yeung?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "songs" ( "number" real, "name_of_the_song" text, "singer" text, "drama" text, "kind_of_the_song" text ); ### SQL Given the database schema, here is the SQL query that answers `Which song has a ending theme, and is sung by miriam yeung?`: ```sql
SELECT "number" FROM "songs" WHERE "name_of_the_song"='實情';
## Task Generate a SQL query to answer the following question: `What is the number of the song named 實情?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "songs" ( "number" real, "name_of_the_song" text, "singer" text, "drama" text, "kind_of_the_song" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the number of the song named 實情?`: ```sql
SELECT COUNT("start") FROM "daytona_500_results" WHERE "finish"<4;
## Task Generate a SQL query to answer the following question: `Name the total number of start when finish is less than 4` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the total number of start when finish is less than 4`: ```sql
SELECT SUM("year") FROM "daytona_500_results" WHERE "start"<30;
## Task Generate a SQL query to answer the following question: `Name the sum of year when start is less than 30` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the sum of year when start is less than 30`: ```sql
SELECT MAX("year") FROM "daytona_500_results" WHERE "start">2;
## Task Generate a SQL query to answer the following question: `Name the most year with start more than 2` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the most year with start more than 2`: ```sql
SELECT MAX("year") FROM "daytona_500_results" WHERE "start"<2;
## Task Generate a SQL query to answer the following question: `Name the most year with start less than 2` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the most year with start less than 2`: ```sql
SELECT "year" FROM "daytona_500_results" WHERE "start"=32;
## Task Generate a SQL query to answer the following question: `Name the year when start was 32` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the year when start was 32`: ```sql
SELECT MAX("finish") FROM "daytona_500_results" WHERE "year"=2006;
## Task Generate a SQL query to answer the following question: `Name the most finish for 2006` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "daytona_500_results" ( "year" real, "manufacturer" text, "start" real, "finish" real, "team" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the most finish for 2006`: ```sql
SELECT COUNT("attendance") FROM "february" WHERE "visitor"='detroit' AND "record"='36–13–5';
## Task Generate a SQL query to answer the following question: `What was the total attendance at games when Detroit was the visiting team and the record was 36–13–5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "february" ( "date" text, "visitor" text, "score" text, "home" text, "decision" text, "attendance" real, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the total attendance at games when Detroit was the visiting team and the record was 36–13–5?`: ```sql
SELECT "entered_office" FROM "minister_for_community_safety_and_legal_" WHERE "first_minister"='henry mcleish';
## Task Generate a SQL query to answer the following question: `When did first minister Henry Mcleish enter office?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `When did first minister Henry Mcleish enter office?`: ```sql
SELECT "name" FROM "minister_for_community_safety_and_legal_" WHERE "left_office"='14 november 2006';
## Task Generate a SQL query to answer the following question: `What is the name of the minister that left office on 14 November 2006?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the name of the minister that left office on 14 November 2006?`: ```sql
SELECT "name" FROM "minister_for_community_safety_and_legal_" WHERE "party"='minister for community safety and legal affairs';
## Task Generate a SQL query to answer the following question: `What is the name of the minister from the party of minister for community safety and legal affairs?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the name of the minister from the party of minister for community safety and legal affairs?`: ```sql
SELECT "name" FROM "minister_for_community_safety_and_legal_" WHERE "entered_office"='entered office';
## Task Generate a SQL query to answer the following question: `What is the name of the minister who has an entered office of entered office?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the name of the minister who has an entered office of entered office?`: ```sql
SELECT "party" FROM "minister_for_community_safety_and_legal_" WHERE "left_office"='26 november 2002';
## Task Generate a SQL query to answer the following question: `What is the party of the minister who left office on 26 November 2002?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the party of the minister who left office on 26 November 2002?`: ```sql
SELECT "party" FROM "minister_for_community_safety_and_legal_" WHERE "name"='richard simpson';
## Task Generate a SQL query to answer the following question: `What is the party of Richard Simpson?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "minister_for_community_safety_and_legal_" ( "name" text, "entered_office" text, "left_office" text, "party" text, "first_minister" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the party of Richard Simpson?`: ```sql
SELECT SUM("spectators") FROM "turkish_national_team" WHERE "time_cest">20.05 AND "team_num2"='estonia';
## Task Generate a SQL query to answer the following question: `Name the sum of spectators for time more than 20.05 and team #2 of estonia` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "turkish_national_team" ( "date" text, "time_cest" real, "team_num1" text, "res" text, "team_num2" text, "round" text, "spectators" real ); ### SQL Given the database schema, here is the SQL query that answers `Name the sum of spectators for time more than 20.05 and team #2 of estonia`: ```sql
SELECT "spectators" FROM "turkish_national_team" WHERE "date"='11 november 2011';
## Task Generate a SQL query to answer the following question: `Name the spectators for 11 november 2011` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "turkish_national_team" ( "date" text, "time_cest" real, "team_num1" text, "res" text, "team_num2" text, "round" text, "spectators" real ); ### SQL Given the database schema, here is the SQL query that answers `Name the spectators for 11 november 2011`: ```sql
SELECT "loss" FROM "game_log" WHERE "record"='54-39';
## Task Generate a SQL query to answer the following question: `Which loss has a Record of 54-39?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Which loss has a Record of 54-39?`: ```sql
SELECT "opponent" FROM "game_log" WHERE "record"='54-38';
## Task Generate a SQL query to answer the following question: `Which opponent has a Record of 54-38?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Which opponent has a Record of 54-38?`: ```sql
SELECT "opponent" FROM "game_log" WHERE "date"='july 7';
## Task Generate a SQL query to answer the following question: `Which opponent has a date of July 7?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Which opponent has a date of July 7?`: ```sql
SELECT "record" FROM "game_log" WHERE "loss"='eichhorn (8-5)';
## Task Generate a SQL query to answer the following question: `Which record has a Loss of eichhorn (8-5)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Which record has a Loss of eichhorn (8-5)?`: ```sql
SELECT AVG("attendance") FROM "november" WHERE "home"='san jose';
## Task Generate a SQL query to answer the following question: `What is the average attendance San Jose home games?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "november" ( "date" text, "visitor" text, "score" text, "home" text, "decision" text, "attendance" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the average attendance San Jose home games?`: ```sql
SELECT "home" FROM "november" WHERE "attendance">'18,118' AND "visitor"='nashville';
## Task Generate a SQL query to answer the following question: `Who was the attendance at the game attended by 18,118 with a visiting team of Nashville?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "november" ( "date" text, "visitor" text, "score" text, "home" text, "decision" text, "attendance" real ); ### SQL Given the database schema, here is the SQL query that answers `Who was the attendance at the game attended by 18,118 with a visiting team of Nashville?`: ```sql
SELECT "record" FROM "game_log" WHERE "loss"='spillner (1-8)';
## Task Generate a SQL query to answer the following question: `What was the record at the game that had a loss of Spillner (1-8)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the record at the game that had a loss of Spillner (1-8)?`: ```sql
SELECT "score" FROM "game_log" WHERE "loss"='williams (1-1)';
## Task Generate a SQL query to answer the following question: `What was the score of the game that had a loss of Williams (1-1)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the score of the game that had a loss of Williams (1-1)?`: ```sql
SELECT "loss" FROM "game_log" WHERE "record"='63-52';
## Task Generate a SQL query to answer the following question: `What was the loss of the game that had a record of 63-52?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the loss of the game that had a record of 63-52?`: ```sql
SELECT "score" FROM "game_log" WHERE "record"='11-10';
## Task Generate a SQL query to answer the following question: `What was the score when the Washington Nationals had a record of 11-10?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" real, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the score when the Washington Nationals had a record of 11-10?`: ```sql
SELECT "opponent" FROM "game_log" WHERE "record"='8-4';
## Task Generate a SQL query to answer the following question: `Who was the opponent when the Washington Nationals had a record of 8-4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" real, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the opponent when the Washington Nationals had a record of 8-4?`: ```sql
SELECT COUNT("attendance") FROM "game_log" WHERE "score"='7-3' AND "loss"='worrell (0-1)';
## Task Generate a SQL query to answer the following question: `How many people were in attendance when the Washington Nationals had a score of 7-3 and a loss of Worrell (0-1)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" real, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `How many people were in attendance when the Washington Nationals had a score of 7-3 and a loss of Worrell (0-1)?`: ```sql
SELECT "qual_2" FROM "qualifying_results" WHERE "name"='katherine legge';
## Task Generate a SQL query to answer the following question: `Name the Qual 2 which has the name of katherine legge` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualifying_results" ( "name" text, "team" text, "qual_1" text, "qual_2" text, "best" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the Qual 2 which has the name of katherine legge`: ```sql
SELECT "team" FROM "qualifying_results" WHERE "best"='58.846';
## Task Generate a SQL query to answer the following question: `Name the team with best of 58.846` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualifying_results" ( "name" text, "team" text, "qual_1" text, "qual_2" text, "best" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the team with best of 58.846`: ```sql
SELECT "name" FROM "qualifying_results" WHERE "best"='58.403';
## Task Generate a SQL query to answer the following question: `Tell me the name with best of 58.403` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualifying_results" ( "name" text, "team" text, "qual_1" text, "qual_2" text, "best" text ); ### SQL Given the database schema, here is the SQL query that answers `Tell me the name with best of 58.403`: ```sql
SELECT "qual_1" FROM "qualifying_results" WHERE "name"='jan heylen';
## Task Generate a SQL query to answer the following question: `Tell me the qual 1 for jan heylen` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualifying_results" ( "name" text, "team" text, "qual_1" text, "qual_2" text, "best" text ); ### SQL Given the database schema, here is the SQL query that answers `Tell me the qual 1 for jan heylen`: ```sql
SELECT "loss" FROM "game_log" WHERE "attendance"='24,406';
## Task Generate a SQL query to answer the following question: `When the attendance was 24,406 who lost?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `When the attendance was 24,406 who lost?`: ```sql
SELECT "opponent" FROM "game_log" WHERE "record"='17-25';
## Task Generate a SQL query to answer the following question: `Which of the opponents has a record of 17-25?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Which of the opponents has a record of 17-25?`: ```sql
SELECT "opponent" FROM "game_log" WHERE "date"='may 12';
## Task Generate a SQL query to answer the following question: `Who was the opponent that played on may 12?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "game_log" ( "date" text, "opponent" text, "score" text, "loss" text, "attendance" text, "record" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the opponent that played on may 12?`: ```sql
SELECT MIN("attendance") FROM "premier_league" WHERE "league_position"='1st' AND "opponents"='west ham united';
## Task Generate a SQL query to answer the following question: `When in the 1st league position, how many people watch as they faced West Ham United?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "premier_league" ( "date" text, "opponents" text, "result_f_a" text, "attendance" real, "league_position" text ); ### SQL Given the database schema, here is the SQL query that answers `When in the 1st league position, how many people watch as they faced West Ham United?`: ```sql
SELECT "result_f_a" FROM "premier_league" WHERE "attendance">'67,577' AND "opponents"='west ham united';
## Task Generate a SQL query to answer the following question: `What was the result with West Ham United with more than 67,577 in attendance?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "premier_league" ( "date" text, "opponents" text, "result_f_a" text, "attendance" real, "league_position" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the result with West Ham United with more than 67,577 in attendance?`: ```sql
SELECT AVG("bronze") FROM "medals_table" WHERE "nation"='uganda' AND "total">2;
## Task Generate a SQL query to answer the following question: `What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medals_table" ( "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the average bronze medals of Uganda's swimmers when they earned over 2 medals?`: ```sql
SELECT MAX("silver") FROM "medals_table" WHERE "bronze"<3 AND "gold"<1 AND "total"=1 AND "nation"='ireland';
## Task Generate a SQL query to answer the following question: `What is the highest number of silver medals that Ireland earned when they scored less than 3 bronze medals and earned 1 medal?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medals_table" ( "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the highest number of silver medals that Ireland earned when they scored less than 3 bronze medals and earned 1 medal?`: ```sql
SELECT MAX("silver") FROM "total" WHERE "gold"=1 AND "nation"='djibouti' AND "total"<3;
## Task Generate a SQL query to answer the following question: `What's the highest silver and 1 gold that the nation of djibouti received with a total less than 3?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "total" ( "rank" real, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the highest silver and 1 gold that the nation of djibouti received with a total less than 3?`: ```sql
SELECT COUNT("total") FROM "total" WHERE "rank">17 AND "gold">0;
## Task Generate a SQL query to answer the following question: `What's the total number that had a rank larger than 17 and a gold greater than 0?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "total" ( "rank" real, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the total number that had a rank larger than 17 and a gold greater than 0?`: ```sql
SELECT "opponent" FROM "schedule" WHERE "week"<2;
## Task Generate a SQL query to answer the following question: `Which opponent was faced before week 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "schedule" ( "week" real, "date" text, "opponent" text, "result" text, "attendance" real ); ### SQL Given the database schema, here is the SQL query that answers `Which opponent was faced before week 2?`: ```sql
SELECT MIN("total") FROM "made_the_cut" WHERE "year_s_won"='1978';
## Task Generate a SQL query to answer the following question: `Name the least total for 1978 years won` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "made_the_cut" ( "player" text, "country" text, "year_s_won" text, "total" real, "to_par" text, "finish" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the least total for 1978 years won`: ```sql
SELECT "total" FROM "made_the_cut" WHERE "finish"='t22';
## Task Generate a SQL query to answer the following question: `Name the total with finish of t22` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "made_the_cut" ( "player" text, "country" text, "year_s_won" text, "total" real, "to_par" text, "finish" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the total with finish of t22`: ```sql
SELECT AVG("total") FROM "made_the_cut" WHERE "year_s_won"='1975';
## Task Generate a SQL query to answer the following question: `Name the average total for years won of 1975` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "made_the_cut" ( "player" text, "country" text, "year_s_won" text, "total" real, "to_par" text, "finish" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the average total for years won of 1975`: ```sql
SELECT "finish" FROM "made_the_cut" WHERE "player"='lou graham';
## Task Generate a SQL query to answer the following question: `Name the finish with player lou graham` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "made_the_cut" ( "player" text, "country" text, "year_s_won" text, "total" real, "to_par" text, "finish" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the finish with player lou graham`: ```sql
SELECT COUNT("total") FROM "made_the_cut" WHERE "finish"='t45';
## Task Generate a SQL query to answer the following question: `Name the total number of total with finish of t45` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "made_the_cut" ( "player" text, "country" text, "year_s_won" text, "total" real, "to_par" text, "finish" text ); ### SQL Given the database schema, here is the SQL query that answers `Name the total number of total with finish of t45`: ```sql
SELECT "year" FROM "achievements" WHERE "league"='malaysian super league' AND "malaysia_cup"='group stage';
## Task Generate a SQL query to answer the following question: `What year was the League the malaysian super league, and a Malaysia Cup of group stage?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" text, "position" text, "league" text, "fa_cup" text, "malaysia_cup" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was the League the malaysian super league, and a Malaysia Cup of group stage?`: ```sql
SELECT "position" FROM "achievements" WHERE "league"='malaysian super league' AND "year"='2011';
## Task Generate a SQL query to answer the following question: `What is the position when the League is the malaysian super league, and a Year of 2011?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" text, "position" text, "league" text, "fa_cup" text, "malaysia_cup" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the position when the League is the malaysian super league, and a Year of 2011?`: ```sql
SELECT "year" FROM "achievements" WHERE "position"='6/13';
## Task Generate a SQL query to answer the following question: `What year was the position 6/13?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" text, "position" text, "league" text, "fa_cup" text, "malaysia_cup" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was the position 6/13?`: ```sql
SELECT "year" FROM "achievements" WHERE "league"='malaysian super league' AND "position"='10/14';
## Task Generate a SQL query to answer the following question: `What year was the League of malaysian super league, and the Position was 10/14?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" text, "position" text, "league" text, "fa_cup" text, "malaysia_cup" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was the League of malaysian super league, and the Position was 10/14?`: ```sql
SELECT AVG("roll") FROM "south_wairarapa_district" WHERE "area"='featherston' AND "authority"='integrated';
## Task Generate a SQL query to answer the following question: `tell me the average roll for the featherston area and integrated authority.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "south_wairarapa_district" ( "name" text, "years" text, "gender" text, "area" text, "authority" text, "decile" real, "roll" real ); ### SQL Given the database schema, here is the SQL query that answers `tell me the average roll for the featherston area and integrated authority.`: ```sql
SELECT "authority" FROM "south_wairarapa_district" WHERE "decile"<6 AND "roll"<65;
## Task Generate a SQL query to answer the following question: `tell me the authority that has a decile less than 6 and roll less than 65.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "south_wairarapa_district" ( "name" text, "years" text, "gender" text, "area" text, "authority" text, "decile" real, "roll" real ); ### SQL Given the database schema, here is the SQL query that answers `tell me the authority that has a decile less than 6 and roll less than 65.`: ```sql
SELECT AVG("roll") FROM "south_wairarapa_district" WHERE "name"='pirinoa school';
## Task Generate a SQL query to answer the following question: `tell me the average roll for pirinoa school.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "south_wairarapa_district" ( "name" text, "years" text, "gender" text, "area" text, "authority" text, "decile" real, "roll" real ); ### SQL Given the database schema, here is the SQL query that answers `tell me the average roll for pirinoa school.`: ```sql
SELECT COUNT("decile") FROM "south_wairarapa_district" WHERE "roll"=251;
## Task Generate a SQL query to answer the following question: `tell me the total number of decile with a roll showing 251.` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "south_wairarapa_district" ( "name" text, "years" text, "gender" text, "area" text, "authority" text, "decile" real, "roll" real ); ### SQL Given the database schema, here is the SQL query that answers `tell me the total number of decile with a roll showing 251.`: ```sql
SELECT "score" FROM "external_links" WHERE "year"=2004;
## Task Generate a SQL query to answer the following question: `What is the score for 2004?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "external_links" ( "year" real, "champion" text, "score" text, "defeated" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the score for 2004?`: ```sql