output
stringlengths
27
479
instruction
stringlengths
407
1.39k
SELECT "venue" FROM "achievements" WHERE "competition"='asian games' AND "event"='4x400 m relay' AND "year"=2002;
## Task Generate a SQL query to answer the following question: `what is the venue when the competition is asian games, the event is 4x400 m relay and the year is 2002?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" real, "competition" text, "venue" text, "position" text, "event" text ); ### SQL Given the database schema, here is the SQL query that answers `what is the venue when the competition is asian games, the event is 4x400 m relay and the year is 2002?`: ```sql
SELECT "spokespersons" FROM "international_broadcasts_and_voting" WHERE "commentator"='pierre tchernia' AND "voting_order"=11;
## Task Generate a SQL query to answer the following question: `During the voting order 11, when the commentator was pierre tchernia, who was the spokesperson?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts_and_voting" ( "voting_order" real, "country" text, "spokespersons" text, "commentator" text, "broadcaster" text ); ### SQL Given the database schema, here is the SQL query that answers `During the voting order 11, when the commentator was pierre tchernia, who was the spokesperson?`: ```sql
SELECT SUM("voting_order") FROM "international_broadcasts_and_voting" WHERE "commentator"='bunny carr';
## Task Generate a SQL query to answer the following question: `What was the voting order when bunny carr was the commentator?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts_and_voting" ( "voting_order" real, "country" text, "spokespersons" text, "commentator" text, "broadcaster" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the voting order when bunny carr was the commentator?`: ```sql
SELECT "commentator" FROM "international_broadcasts_and_voting" WHERE "spokespersons"='michael aspel';
## Task Generate a SQL query to answer the following question: `Who was the commentator when the spokesperson was michael aspel?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts_and_voting" ( "voting_order" real, "country" text, "spokespersons" text, "commentator" text, "broadcaster" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the commentator when the spokesperson was michael aspel?`: ```sql
SELECT "voting_order" FROM "international_broadcasts_and_voting" WHERE "commentator"='renato tagliani';
## Task Generate a SQL query to answer the following question: `What was the voting order when the commentator was renato tagliani?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts_and_voting" ( "voting_order" real, "country" text, "spokespersons" text, "commentator" text, "broadcaster" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the voting order when the commentator was renato tagliani?`: ```sql
SELECT AVG("bronze") FROM "medal_table" WHERE "total"<1;
## Task Generate a SQL query to answer the following question: `Which Bronze has a Total smaller than 1?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medal_table" ( "rank" real, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Bronze has a Total smaller than 1?`: ```sql
SELECT COUNT("silver") FROM "medal_table" WHERE "bronze">1 AND "gold"=0 AND "rank"<4;
## Task Generate a SQL query to answer the following question: `How much Silver has a Bronze larger than 1, and a Gold of 0, and a Rank smaller than 4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medal_table" ( "rank" real, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `How much Silver has a Bronze larger than 1, and a Gold of 0, and a Rank smaller than 4?`: ```sql
SELECT MAX("bronze") FROM "medal_table" WHERE "rank"=4 AND "gold"<0;
## Task Generate a SQL query to answer the following question: `Which Bronze has a Rank of 4, and a Gold smaller than 0?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medal_table" ( "rank" real, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Bronze has a Rank of 4, and a Gold smaller than 0?`: ```sql
SELECT SUM("gold") FROM "medal_table" WHERE "bronze"<2 AND "silver"=0 AND "rank">3;
## Task Generate a SQL query to answer the following question: `How much Gold has a Bronze smaller than 2, and a Silver of 0, and a Rank larger than 3?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medal_table" ( "rank" real, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `How much Gold has a Bronze smaller than 2, and a Silver of 0, and a Rank larger than 3?`: ```sql
SELECT "percentage_2011" FROM "mother_tongue_language_2006_and_2011" WHERE "population_2006">120 AND "percentage_2006"='45.22%';
## Task Generate a SQL query to answer the following question: `What percentage of the 2011 population had a mother tongue language that was spoken by 45.22% of the population in 2006 (over 120)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "mother_tongue_language_2006_and_2011" ( "mother_tongue" text, "population_2006" real, "percentage_2006" text, "population_2011" real, "percentage_2011" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of the 2011 population had a mother tongue language that was spoken by 45.22% of the population in 2006 (over 120)?`: ```sql
SELECT COUNT("population_2011") FROM "mother_tongue_language_2006_and_2011" WHERE "population_2006"=120;
## Task Generate a SQL query to answer the following question: `What is the total number of people in 2011 speaking the mother tongue language spoken by 120 in 2006?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "mother_tongue_language_2006_and_2011" ( "mother_tongue" text, "population_2006" real, "percentage_2006" text, "population_2011" real, "percentage_2011" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the total number of people in 2011 speaking the mother tongue language spoken by 120 in 2006?`: ```sql
SELECT MAX("population_2006") FROM "mother_tongue_language_2006_and_2011" WHERE "mother_tongue"='romanian';
## Task Generate a SQL query to answer the following question: `How many people ha Romanian as their mother tongue in 2006?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "mother_tongue_language_2006_and_2011" ( "mother_tongue" text, "population_2006" real, "percentage_2006" text, "population_2011" real, "percentage_2011" text ); ### SQL Given the database schema, here is the SQL query that answers `How many people ha Romanian as their mother tongue in 2006?`: ```sql
SELECT "mother_tongue" FROM "mother_tongue_language_2006_and_2011" WHERE "population_2006"=300;
## Task Generate a SQL query to answer the following question: `What is the mother tongue language shared by 300 people in 2006?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "mother_tongue_language_2006_and_2011" ( "mother_tongue" text, "population_2006" real, "percentage_2006" text, "population_2011" real, "percentage_2011" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the mother tongue language shared by 300 people in 2006?`: ```sql
SELECT "percentage_2011" FROM "mother_tongue_language_2006_and_2011" WHERE "population_2006"<'8,085' AND "population_2011"<145;
## Task Generate a SQL query to answer the following question: `What percentage of people in 2011 had a mother tongue that was shared by less than 8,085 in 2006 and less than 145 in 2011?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "mother_tongue_language_2006_and_2011" ( "mother_tongue" text, "population_2006" real, "percentage_2006" text, "population_2011" real, "percentage_2011" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of people in 2011 had a mother tongue that was shared by less than 8,085 in 2006 and less than 145 in 2011?`: ```sql
SELECT COUNT("points") FROM "results" WHERE "english_translation"='long live life' AND "draw"<2;
## Task Generate a SQL query to answer the following question: `What's the total number of points when the English translation is Long Live Life and the draw is less than 2?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results" ( "draw" real, "language" text, "song" text, "english_translation" text, "place" real, "points" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the total number of points when the English translation is Long Live Life and the draw is less than 2?`: ```sql
SELECT "language" FROM "results" WHERE "draw"=9;
## Task Generate a SQL query to answer the following question: `What's the language of Draw number 9?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results" ( "draw" real, "language" text, "song" text, "english_translation" text, "place" real, "points" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the language of Draw number 9?`: ```sql
SELECT MIN("points") FROM "results" WHERE "language"='portuguese';
## Task Generate a SQL query to answer the following question: `What are the lowest points when the language is Portuguese?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results" ( "draw" real, "language" text, "song" text, "english_translation" text, "place" real, "points" real ); ### SQL Given the database schema, here is the SQL query that answers `What are the lowest points when the language is Portuguese?`: ```sql
SELECT "island" FROM "the_six_s_ultra_prominent_summit_of_the_" WHERE "summit"='haleakalā';
## Task Generate a SQL query to answer the following question: `What's the island with a summit of Haleakalā?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "the_six_s_ultra_prominent_summit_of_the_" ( "rank" real, "summit" text, "country" text, "island" text, "col_m" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the island with a summit of Haleakalā?`: ```sql
SELECT MIN("col_m") FROM "the_six_s_ultra_prominent_summit_of_the_" WHERE "island"='island of molokaʻi' AND "rank"<6;
## Task Generate a SQL query to answer the following question: `What's the lowest Col ranked less than 6 with an Island of Molokaʻi?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "the_six_s_ultra_prominent_summit_of_the_" ( "rank" real, "summit" text, "country" text, "island" text, "col_m" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the lowest Col ranked less than 6 with an Island of Molokaʻi?`: ```sql
SELECT "col_m" FROM "the_six_s_ultra_prominent_summit_of_the_" WHERE "rank">4 AND "summit"='kawaikini';
## Task Generate a SQL query to answer the following question: `What's the col (m) ranked more than 4 with a summit of Kawaikini?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "the_six_s_ultra_prominent_summit_of_the_" ( "rank" real, "summit" text, "country" text, "island" text, "col_m" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the col (m) ranked more than 4 with a summit of Kawaikini?`: ```sql
SELECT SUM("rank") FROM "the_six_s_ultra_prominent_summit_of_the_" WHERE "col_m"<33 AND "summit"='haleakalā';
## Task Generate a SQL query to answer the following question: `What's the rank when the col (m) is less than 33 and has a summit of Haleakalā?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "the_six_s_ultra_prominent_summit_of_the_" ( "rank" real, "summit" text, "country" text, "island" text, "col_m" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the rank when the col (m) is less than 33 and has a summit of Haleakalā?`: ```sql
SELECT "summit" FROM "the_six_s_ultra_prominent_summit_of_the_" WHERE "col_m"=0 AND "rank"<2;
## Task Generate a SQL query to answer the following question: `What's the summit when the rank is less than 2 and has a col (m) of 0?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "the_six_s_ultra_prominent_summit_of_the_" ( "rank" real, "summit" text, "country" text, "island" text, "col_m" real ); ### SQL Given the database schema, here is the SQL query that answers `What's the summit when the rank is less than 2 and has a col (m) of 0?`: ```sql
SELECT "year" FROM "games" WHERE "edition"='41st';
## Task Generate a SQL query to answer the following question: `Which Year has an Edition of 41st?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "games" ( "edition" text, "year" text, "city" text, "country" text, "date" text, "no_of_events" real, "top_team" text ); ### SQL Given the database schema, here is the SQL query that answers `Which Year has an Edition of 41st?`: ```sql
SELECT "no_of_events" FROM "games" WHERE "country"='trinidad and tobago' AND "date"='march 30-april 1';
## Task Generate a SQL query to answer the following question: `How many Events have a Country of trinidad and tobago, and a Date of march 30-april 1?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "games" ( "edition" text, "year" text, "city" text, "country" text, "date" text, "no_of_events" real, "top_team" text ); ### SQL Given the database schema, here is the SQL query that answers `How many Events have a Country of trinidad and tobago, and a Date of march 30-april 1?`: ```sql
SELECT "country" FROM "games" WHERE "top_team"='jam' AND "edition"='31st';
## Task Generate a SQL query to answer the following question: `Which Country has a Top Team of jam, and an Edition of 31st?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "games" ( "edition" text, "year" text, "city" text, "country" text, "date" text, "no_of_events" real, "top_team" text ); ### SQL Given the database schema, here is the SQL query that answers `Which Country has a Top Team of jam, and an Edition of 31st?`: ```sql
SELECT "outcome" FROM "doubles_titles_22_19" WHERE "partner"='brett steven';
## Task Generate a SQL query to answer the following question: `What was the outcome of the final with a partner of Brett Steven?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "doubles_titles_22_19" ( "outcome" text, "date" text, "tournament" text, "surface" text, "partner" text, "opponents_in_the_final" text, "score_in_the_final" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the outcome of the final with a partner of Brett Steven?`: ```sql
SELECT "surface" FROM "doubles_titles_21" WHERE "tournament"='italy f28';
## Task Generate a SQL query to answer the following question: `On what type of surface was the tournament of Italy f28?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "doubles_titles_21" ( "date" text, "tournament" text, "surface" text, "partner" text, "opponent_in_the_final" text, "score_in_the_final" text ); ### SQL Given the database schema, here is the SQL query that answers `On what type of surface was the tournament of Italy f28?`: ```sql
SELECT "opponent_in_the_final" FROM "doubles_titles_21" WHERE "tournament"='senegal f2';
## Task Generate a SQL query to answer the following question: `Who was the opponent in the final of the Senegal f2 tournament>` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "doubles_titles_21" ( "date" text, "tournament" text, "surface" text, "partner" text, "opponent_in_the_final" text, "score_in_the_final" text ); ### SQL Given the database schema, here is the SQL query that answers `Who was the opponent in the final of the Senegal f2 tournament>`: ```sql
SELECT "score" FROM "international_goals" WHERE "date"='december 12, 1998';
## Task Generate a SQL query to answer the following question: `What's the score on December 12, 1998?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_goals" ( "date" text, "venue" text, "score" text, "result" text, "competition" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the score on December 12, 1998?`: ```sql
SELECT "venue" FROM "international_goals" WHERE "score"='7-1';
## Task Generate a SQL query to answer the following question: `What was the venue when the score was 7-1?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_goals" ( "date" text, "venue" text, "score" text, "result" text, "competition" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the venue when the score was 7-1?`: ```sql
SELECT "score" FROM "international_goals" WHERE "competition"='friendly';
## Task Generate a SQL query to answer the following question: `What's the score of the friendly competition?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_goals" ( "date" text, "venue" text, "score" text, "result" text, "competition" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the score of the friendly competition?`: ```sql
SELECT "competition" FROM "international_goals" WHERE "venue"='singapore';
## Task Generate a SQL query to answer the following question: `What's the competition that happened in Singapore?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_goals" ( "date" text, "venue" text, "score" text, "result" text, "competition" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the competition that happened in Singapore?`: ```sql
SELECT "venue" FROM "international_goals" WHERE "competition"='1995 southeast asian games';
## Task Generate a SQL query to answer the following question: `What's the venue of the 1995 Southeast Asian Games?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_goals" ( "date" text, "venue" text, "score" text, "result" text, "competition" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the venue of the 1995 Southeast Asian Games?`: ```sql
SELECT "date_of_inauguration" FROM "list" WHERE "lifespan"='lifespan';
## Task Generate a SQL query to answer the following question: `What was the date of the inauguration in the row with an entry of lifespan in the lifespan column?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list" ( "president" text, "date_of_birth" text, "date_of_inauguration" text, "age_at_inauguration" text, "end_of_term" text, "length_of_retirement" text, "date_of_death" text, "lifespan" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the date of the inauguration in the row with an entry of lifespan in the lifespan column?`: ```sql
SELECT "date_of_death" FROM "list" WHERE "date_of_inauguration"='date of inauguration';
## Task Generate a SQL query to answer the following question: `What was the date of death entry in the row that has a date of inauguration entry of date of inauguration?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list" ( "president" text, "date_of_birth" text, "date_of_inauguration" text, "age_at_inauguration" text, "end_of_term" text, "length_of_retirement" text, "date_of_death" text, "lifespan" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the date of death entry in the row that has a date of inauguration entry of date of inauguration?`: ```sql
SELECT "length_of_retirement" FROM "list" WHERE "president"='sharma, shankar shankar dayal sharma';
## Task Generate a SQL query to answer the following question: `What is the length of retirement for president Sharma, Shankar Shankar Dayal Sharma?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "list" ( "president" text, "date_of_birth" text, "date_of_inauguration" text, "age_at_inauguration" text, "end_of_term" text, "length_of_retirement" text, "date_of_death" text, "lifespan" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the length of retirement for president Sharma, Shankar Shankar Dayal Sharma?`: ```sql
SELECT COUNT("draw") FROM "results_of_heat_5" WHERE "place"<1;
## Task Generate a SQL query to answer the following question: `How many draw is in a place that is less than 1?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results_of_heat_5" ( "draw" real, "artist" text, "song" text, "percentage" text, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `How many draw is in a place that is less than 1?`: ```sql
SELECT "percentage" FROM "results_of_heat_5" WHERE "place"<5 AND "draw">3 AND "song"='\"s teb\"';
## Task Generate a SQL query to answer the following question: `What percentage has a less than 5 place, and a greater than 3 draw, and "S Teb" as the song?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results_of_heat_5" ( "draw" real, "artist" text, "song" text, "percentage" text, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `What percentage has a less than 5 place, and a greater than 3 draw, and "S Teb" as the song?`: ```sql
SELECT AVG("draw") FROM "results_of_heat_5" WHERE "artist"='emilya valenti';
## Task Generate a SQL query to answer the following question: `Emilya Valenti has what draw average?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "results_of_heat_5" ( "draw" real, "artist" text, "song" text, "percentage" text, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `Emilya Valenti has what draw average?`: ```sql
SELECT "airing_date" FROM "second_line_series" WHERE "official_website"='official website' AND "number_of_episodes"=20 AND "genre"='modern action' AND "english_title_chinese_title"='armed reaction 陀槍師姐';
## Task Generate a SQL query to answer the following question: `What's the airing date of Armed Reaction 陀槍師姐 with 20 episodes in the Modern Action genre having an official website?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "second_line_series" ( "airing_date" text, "english_title_chinese_title" text, "number_of_episodes" real, "genre" text, "official_website" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the airing date of Armed Reaction 陀槍師姐 with 20 episodes in the Modern Action genre having an official website?`: ```sql
SELECT "airing_date" FROM "second_line_series" WHERE "number_of_episodes"=62;
## Task Generate a SQL query to answer the following question: `What's the airing date for the show with 62 episodes?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "second_line_series" ( "airing_date" text, "english_title_chinese_title" text, "number_of_episodes" real, "genre" text, "official_website" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the airing date for the show with 62 episodes?`: ```sql
SELECT "official_website" FROM "second_line_series" WHERE "number_of_episodes">22 AND "english_title_chinese_title"='burning flame 烈火雄心';
## Task Generate a SQL query to answer the following question: `What's the official website of Burning Flame 烈火雄心 with 22 episodes?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "second_line_series" ( "airing_date" text, "english_title_chinese_title" text, "number_of_episodes" real, "genre" text, "official_website" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the official website of Burning Flame 烈火雄心 with 22 episodes?`: ```sql
SELECT "position" FROM "qualified_competitors" WHERE "a_score">7;
## Task Generate a SQL query to answer the following question: `what is the position for the competitor that has a score more than 7` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualified_competitors" ( "position" text, "gymnast" text, "a_score" real, "b_score" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `what is the position for the competitor that has a score more than 7`: ```sql
SELECT MIN("b_score") FROM "qualified_competitors" WHERE "position"='5th' AND "a_score"<7;
## Task Generate a SQL query to answer the following question: `what is the score for the 5th position and a score less than 7` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualified_competitors" ( "position" text, "gymnast" text, "a_score" real, "b_score" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `what is the score for the 5th position and a score less than 7`: ```sql
SELECT MAX("total") FROM "qualified_competitors" WHERE "position"='8th' AND "a_score">6.6;
## Task Generate a SQL query to answer the following question: `what is the total scored for the 8th position and a score more than 6.6` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "qualified_competitors" ( "position" text, "gymnast" text, "a_score" real, "b_score" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `what is the total scored for the 8th position and a score more than 6.6`: ```sql
SELECT "meet" FROM "women" WHERE "time"='7:55.02';
## Task Generate a SQL query to answer the following question: `What is the Meet of the Event with a Time of 7:55.02?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "women" ( "event" text, "time" text, "nationality" text, "date" text, "meet" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the Meet of the Event with a Time of 7:55.02?`: ```sql
SELECT "location" FROM "women" WHERE "time"='2:22.32';
## Task Generate a SQL query to answer the following question: `What is the Location of the Event with a Time of 2:22.32?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "women" ( "event" text, "time" text, "nationality" text, "date" text, "meet" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the Location of the Event with a Time of 2:22.32?`: ```sql
SELECT MIN("body_width_mm") FROM "type_i" WHERE "lead_pitch_mm"<0.55 AND "body_length_mm">18.4;
## Task Generate a SQL query to answer the following question: `Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Body Length/mm larger than 18.4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "type_i" ( "part_number" text, "pins" text, "body_width_mm" real, "body_length_mm" real, "lead_pitch_mm" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Body Length/mm larger than 18.4?`: ```sql
SELECT AVG("body_length_mm") FROM "type_i" WHERE "lead_pitch_mm"<0.5;
## Task Generate a SQL query to answer the following question: `Which Body Length/mm has a Lead Pitch/mm smaller than 0.5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "type_i" ( "part_number" text, "pins" text, "body_width_mm" real, "body_length_mm" real, "lead_pitch_mm" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Body Length/mm has a Lead Pitch/mm smaller than 0.5?`: ```sql
SELECT COUNT("body_width_mm") FROM "type_i" WHERE "body_length_mm"=18.4 AND "pins"='40';
## Task Generate a SQL query to answer the following question: `How much Body Width/mm has a Body Length/mm of 18.4, and Pins of 40?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "type_i" ( "part_number" text, "pins" text, "body_width_mm" real, "body_length_mm" real, "lead_pitch_mm" real ); ### SQL Given the database schema, here is the SQL query that answers `How much Body Width/mm has a Body Length/mm of 18.4, and Pins of 40?`: ```sql
SELECT MIN("body_width_mm") FROM "type_i" WHERE "lead_pitch_mm"<0.55 AND "part_number"='tsop48';
## Task Generate a SQL query to answer the following question: `Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "type_i" ( "part_number" text, "pins" text, "body_width_mm" real, "body_length_mm" real, "lead_pitch_mm" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?`: ```sql
SELECT MAX("lead_pitch_mm") FROM "type_i" WHERE "part_number"='tsop40' AND "body_length_mm">18.4;
## Task Generate a SQL query to answer the following question: `Which Lead Pitch/mm has a Part Number of tsop40, and a Body Length/mm larger than 18.4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "type_i" ( "part_number" text, "pins" text, "body_width_mm" real, "body_length_mm" real, "lead_pitch_mm" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Lead Pitch/mm has a Part Number of tsop40, and a Body Length/mm larger than 18.4?`: ```sql
SELECT MIN("attendance") FROM "toronto_blue_jays_vs_oakland_athletics" WHERE "time"='3:15';
## Task Generate a SQL query to answer the following question: `What was the least attendance when the time was 3:15?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "toronto_blue_jays_vs_oakland_athletics" ( "game" real, "date" text, "location" text, "time" text, "attendance" real ); ### SQL Given the database schema, here is the SQL query that answers `What was the least attendance when the time was 3:15?`: ```sql
SELECT "date" FROM "toronto_blue_jays_vs_oakland_athletics" WHERE "game"<5 AND "location"='oakland-alameda county coliseum' AND "time"='3:40';
## Task Generate a SQL query to answer the following question: `What date was at Oakland-Alameda County Coliseum with a time of 3:40 and a game less than 5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "toronto_blue_jays_vs_oakland_athletics" ( "game" real, "date" text, "location" text, "time" text, "attendance" real ); ### SQL Given the database schema, here is the SQL query that answers `What date was at Oakland-Alameda County Coliseum with a time of 3:40 and a game less than 5?`: ```sql
SELECT AVG("bronze") FROM "by_city" WHERE "gold">1 AND "total">11 AND "silver">5;
## Task Generate a SQL query to answer the following question: `Which Bronze has a Gold larger than 1, and a Total larger than 11, and a Silver larger than 5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "by_city" ( "rank" real, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `Which Bronze has a Gold larger than 1, and a Total larger than 11, and a Silver larger than 5?`: ```sql
SELECT COUNT("silver") FROM "by_city" WHERE "gold">2;
## Task Generate a SQL query to answer the following question: `How many silvers have more than 2 golds?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "by_city" ( "rank" real, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `How many silvers have more than 2 golds?`: ```sql
SELECT "firefox_other_mozilla" FROM "usa_usage_share_data_from_stat_owl_com" WHERE "chrome"='1.93%';
## Task Generate a SQL query to answer the following question: `What percentage of browsers were using Firefox or other Mozilla browsers during the period in which 1.93% were using Chrome?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "usa_usage_share_data_from_stat_owl_com" ( "internet_explorer" text, "firefox_other_mozilla" text, "chrome" text, "safari" text, "opera" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of browsers were using Firefox or other Mozilla browsers during the period in which 1.93% were using Chrome?`: ```sql
SELECT "internet_explorer" FROM "usa_usage_share_data_from_stat_owl_com" WHERE "chrome"='24.91%';
## Task Generate a SQL query to answer the following question: `What percentage of browsers were using Internet Explorer during the period in which 24.91% were using Chrome?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "usa_usage_share_data_from_stat_owl_com" ( "internet_explorer" text, "firefox_other_mozilla" text, "chrome" text, "safari" text, "opera" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of browsers were using Internet Explorer during the period in which 24.91% were using Chrome?`: ```sql
SELECT "chrome" FROM "usa_usage_share_data_from_stat_owl_com" WHERE "internet_explorer"='72.03%';
## Task Generate a SQL query to answer the following question: `What percentage of browsers were using Chrome during the period in which 72.03% were using Internet Explorer?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "usa_usage_share_data_from_stat_owl_com" ( "internet_explorer" text, "firefox_other_mozilla" text, "chrome" text, "safari" text, "opera" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of browsers were using Chrome during the period in which 72.03% were using Internet Explorer?`: ```sql
SELECT "safari" FROM "usa_usage_share_data_from_stat_owl_com" WHERE "chrome"='2.05%';
## Task Generate a SQL query to answer the following question: `What percentage of browsers were using Safari during the period in which 2.05% were using Chrome?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "usa_usage_share_data_from_stat_owl_com" ( "internet_explorer" text, "firefox_other_mozilla" text, "chrome" text, "safari" text, "opera" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of browsers were using Safari during the period in which 2.05% were using Chrome?`: ```sql
SELECT "chrome" FROM "usa_usage_share_data_from_stat_owl_com" WHERE "opera"='0.30%' AND "safari"='6.77%';
## Task Generate a SQL query to answer the following question: `What percentage of browsers were using Chrome during the period in which 0.30% were using Opera and 6.77% were using Safari?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "usa_usage_share_data_from_stat_owl_com" ( "internet_explorer" text, "firefox_other_mozilla" text, "chrome" text, "safari" text, "opera" text ); ### SQL Given the database schema, here is the SQL query that answers `What percentage of browsers were using Chrome during the period in which 0.30% were using Opera and 6.77% were using Safari?`: ```sql
SELECT "tv_network_s" FROM "international_broadcasts" WHERE "country"='brazil';
## Task Generate a SQL query to answer the following question: `Which TV network was located in Brazil?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts" ( "country" text, "tv_network_s" text, "series_premiere" text, "weekly_schedule" text, "status" text ); ### SQL Given the database schema, here is the SQL query that answers `Which TV network was located in Brazil?`: ```sql
SELECT "country" FROM "international_broadcasts" WHERE "series_premiere"='unknown' AND "tv_network_s"='mbc action';
## Task Generate a SQL query to answer the following question: `What country has a series premier of unknown and mbc action as their TV network?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts" ( "country" text, "tv_network_s" text, "series_premiere" text, "weekly_schedule" text, "status" text ); ### SQL Given the database schema, here is the SQL query that answers `What country has a series premier of unknown and mbc action as their TV network?`: ```sql
SELECT "weekly_schedule" FROM "international_broadcasts" WHERE "tv_network_s"='sky italia';
## Task Generate a SQL query to answer the following question: `What is the weekly schedule for the network sky italia?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "international_broadcasts" ( "country" text, "tv_network_s" text, "series_premiere" text, "weekly_schedule" text, "status" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the weekly schedule for the network sky italia?`: ```sql
SELECT AVG("gold") FROM "medals_table" WHERE "bronze">6 AND "silver">18;
## Task Generate a SQL query to answer the following question: `How many Gold medals for the Nations with 6 or more Bronze medals and 18 or more Silver?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medals_table" ( "rank" text, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `How many Gold medals for the Nations with 6 or more Bronze medals and 18 or more Silver?`: ```sql
SELECT AVG("gold") FROM "medals_table" WHERE "nation"='soviet union';
## Task Generate a SQL query to answer the following question: `How many Gold medals did the Soviet Union receive?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "medals_table" ( "rank" text, "nation" text, "gold" real, "silver" real, "bronze" real, "total" real ); ### SQL Given the database schema, here is the SQL query that answers `How many Gold medals did the Soviet Union receive?`: ```sql
SELECT "pos" FROM "current_roster" WHERE "2012_club"='new york athletic club' AND "name"='john mann category:articles with hcards';
## Task Generate a SQL query to answer the following question: `What pos is John Mann Category:Articles with Hcards with the New York Athletic Club?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "current_roster" ( "name" text, "pos" text, "height" text, "weight" text, "2012_club" text ); ### SQL Given the database schema, here is the SQL query that answers `What pos is John Mann Category:Articles with Hcards with the New York Athletic Club?`: ```sql
SELECT "weight" FROM "current_roster" WHERE "pos"='cb' AND "2012_club"='new york athletic club';
## Task Generate a SQL query to answer the following question: `What's the weight when the pos is CB and is part of the New York Athletic Club?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "current_roster" ( "name" text, "pos" text, "height" text, "weight" text, "2012_club" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the weight when the pos is CB and is part of the New York Athletic Club?`: ```sql
SELECT "name" FROM "current_roster" WHERE "pos"='cf';
## Task Generate a SQL query to answer the following question: `What's the name of the person in the CF Pos?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "current_roster" ( "name" text, "pos" text, "height" text, "weight" text, "2012_club" text ); ### SQL Given the database schema, here is the SQL query that answers `What's the name of the person in the CF Pos?`: ```sql
SELECT "league_cup_apps" FROM "appearances_and_goals" WHERE "fa_cup_apps"='5';
## Task Generate a SQL query to answer the following question: `Which league cup apps has FA as the cup apps of 5?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "appearances_and_goals" ( "name" text, "position" text, "league_apps" text, "league_goals" real, "fa_cup_apps" text, "fa_cup_goals" real, "league_cup_apps" text, "league_cup_goals" real, "total_apps" text, "total_goals" real ); ### SQL Given the database schema, here is the SQL query that answers `Which league cup apps has FA as the cup apps of 5?`: ```sql
SELECT MIN("league_goals") FROM "appearances_and_goals" WHERE "position"='fw' AND "total_goals">9 AND "league_cup_goals">4;
## Task Generate a SQL query to answer the following question: `What is the lowest league goals that has fw as the position, total goals greater than 9, with league cup goals greater than 4?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "appearances_and_goals" ( "name" text, "position" text, "league_apps" text, "league_goals" real, "fa_cup_apps" text, "fa_cup_goals" real, "league_cup_apps" text, "league_cup_goals" real, "total_apps" text, "total_goals" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the lowest league goals that has fw as the position, total goals greater than 9, with league cup goals greater than 4?`: ```sql
SELECT MIN("year") FROM "achievements" WHERE "event"='team' AND "venue"='vilamoura, portugal';
## Task Generate a SQL query to answer the following question: `What is the earliest year that a team event was included at Vilamoura, Portugal?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" real, "tournament" text, "venue" text, "result" text, "event" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the earliest year that a team event was included at Vilamoura, Portugal?`: ```sql
SELECT "event" FROM "achievements" WHERE "year"<2001 AND "result"='16th';
## Task Generate a SQL query to answer the following question: `In which event before 2001 did the athlete place 16th?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" real, "tournament" text, "venue" text, "result" text, "event" text ); ### SQL Given the database schema, here is the SQL query that answers `In which event before 2001 did the athlete place 16th?`: ```sql
SELECT "tournament" FROM "achievements" WHERE "result"='25th';
## Task Generate a SQL query to answer the following question: `In which tournament was the result 25th?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "achievements" ( "year" real, "tournament" text, "venue" text, "result" text, "event" text ); ### SQL Given the database schema, here is the SQL query that answers `In which tournament was the result 25th?`: ```sql
SELECT AVG("points") FROM "national_final_28_march_1992" WHERE "song"='\"viva rock ''n'' roll\"' AND "draw">3;
## Task Generate a SQL query to answer the following question: `What is the number of points for the song "viva rock 'n' roll", with more than 3 Draws?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "national_final_28_march_1992" ( "draw" real, "artist" text, "song" text, "points" real, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the number of points for the song "viva rock 'n' roll", with more than 3 Draws?`: ```sql
SELECT "artist" FROM "national_final_28_march_1992" WHERE "draw">6 AND "place">14;
## Task Generate a SQL query to answer the following question: `What artist has more than 6 draws, and in a place higher than 14?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "national_final_28_march_1992" ( "draw" real, "artist" text, "song" text, "points" real, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `What artist has more than 6 draws, and in a place higher than 14?`: ```sql
SELECT MAX("place") FROM "national_final_28_march_1992" WHERE "draw">3 AND "song"='\"dajana\"' AND "points"<31;
## Task Generate a SQL query to answer the following question: `What is the highest Place with more than 3 draws, for the Song "dajana", with less than 31 points?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "national_final_28_march_1992" ( "draw" real, "artist" text, "song" text, "points" real, "place" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the highest Place with more than 3 draws, for the Song "dajana", with less than 31 points?`: ```sql
SELECT "social_democratic" FROM "125_seats_needed_for_a_majority" WHERE "democratic_and_social_centre"='10.0% 22 seats';
## Task Generate a SQL query to answer the following question: `What Social Democratic has a Democratic and Social Centre of 10.0% 22 seats?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "125_seats_needed_for_a_majority" ( "date_released" text, "institute" text, "social_democratic" text, "socialist" text, "green_communist" text, "democratic_renewal" text, "democratic_and_social_centre" text, "lead" text ); ### SQL Given the database schema, here is the SQL query that answers `What Social Democratic has a Democratic and Social Centre of 10.0% 22 seats?`: ```sql
SELECT "social_democratic" FROM "125_seats_needed_for_a_majority" WHERE "democratic_and_social_centre"='4.4% 4 seats';
## Task Generate a SQL query to answer the following question: `What Social Democratic has the Democratic and Social Centre of 4.4% 4 seats?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "125_seats_needed_for_a_majority" ( "date_released" text, "institute" text, "social_democratic" text, "socialist" text, "green_communist" text, "democratic_renewal" text, "democratic_and_social_centre" text, "lead" text ); ### SQL Given the database schema, here is the SQL query that answers `What Social Democratic has the Democratic and Social Centre of 4.4% 4 seats?`: ```sql
SELECT "number_of_teams" FROM "yearly_basis" WHERE "top_goalscorer_s"='not awarded' AND "year"='2007 details';
## Task Generate a SQL query to answer the following question: `How many teams were at the 2007 details tournament where there a top goalscorer was not awarded?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "yearly_basis" ( "year" text, "location" text, "number_of_teams" text, "player_of_the_tournament" text, "top_goalscorer_s" text, "best_goalkeeper" text ); ### SQL Given the database schema, here is the SQL query that answers `How many teams were at the 2007 details tournament where there a top goalscorer was not awarded?`: ```sql
SELECT "location" FROM "yearly_basis" WHERE "best_goalkeeper"='164 (8.2)';
## Task Generate a SQL query to answer the following question: `What is the location of the tournament where the best goalkeeper had 164 (8.2)?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "yearly_basis" ( "year" text, "location" text, "number_of_teams" text, "player_of_the_tournament" text, "top_goalscorer_s" text, "best_goalkeeper" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the location of the tournament where the best goalkeeper had 164 (8.2)?`: ```sql
SELECT "section" FROM "season_to_season" WHERE "level"='tier 2' AND "season"=1996;
## Task Generate a SQL query to answer the following question: `What section were they in when there were tier 2 in 1996?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_to_season" ( "season" real, "level" text, "division" text, "section" text, "administration" text, "position" text ); ### SQL Given the database schema, here is the SQL query that answers `What section were they in when there were tier 2 in 1996?`: ```sql
SELECT "administration" FROM "season_to_season" WHERE "division"='ykkönen (first division)' AND "position"='1st' AND "season"=1996;
## Task Generate a SQL query to answer the following question: `What is the administration when the division was Ykkönen (first division), and they were in the 1st position in 1996?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "season_to_season" ( "season" real, "level" text, "division" text, "section" text, "administration" text, "position" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the administration when the division was Ykkönen (first division), and they were in the 1st position in 1996?`: ```sql
SELECT "film_title_used_in_nomination" FROM "nominees" WHERE "actor_actress"='emma thompson' AND "category"='best supporting actress';
## Task Generate a SQL query to answer the following question: `What was the film title that emma thompson was the actress nominated for best supporting actress?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "nominees" ( "year_ceremony" text, "actor_actress" text, "category" text, "film_title_used_in_nomination" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `What was the film title that emma thompson was the actress nominated for best supporting actress?`: ```sql
SELECT "category" FROM "nominees" WHERE "actor_actress"='al pacino' AND "film_title_used_in_nomination"='glengarry glen ross';
## Task Generate a SQL query to answer the following question: `What category was al pacino nominated for in the film, glengarry glen ross?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "nominees" ( "year_ceremony" text, "actor_actress" text, "category" text, "film_title_used_in_nomination" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `What category was al pacino nominated for in the film, glengarry glen ross?`: ```sql
SELECT "year_ceremony" FROM "nominees" WHERE "category"='best actress' AND "actor_actress"='sigourney weaver';
## Task Generate a SQL query to answer the following question: `What is the year when sigourney weaver was nominated for best actress?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "nominees" ( "year_ceremony" text, "actor_actress" text, "category" text, "film_title_used_in_nomination" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the year when sigourney weaver was nominated for best actress?`: ```sql
SELECT "year_ceremony" FROM "nominees" WHERE "result"='nominee' AND "actor_actress"='holly hunter';
## Task Generate a SQL query to answer the following question: `What year was holly hunter a nominee?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "nominees" ( "year_ceremony" text, "actor_actress" text, "category" text, "film_title_used_in_nomination" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `What year was holly hunter a nominee?`: ```sql
SELECT "per_capita_income" FROM "south_carolina_counties_ranked_by_per_ca" WHERE "median_family_income"='$40,492';
## Task Generate a SQL query to answer the following question: `What is the per capita income of the county with a median family income of $40,492?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "south_carolina_counties_ranked_by_per_ca" ( "county" text, "per_capita_income" text, "median_household_income" text, "median_family_income" text, "population" real, "number_of_households" real ); ### SQL Given the database schema, here is the SQL query that answers `What is the per capita income of the county with a median family income of $40,492?`: ```sql
SELECT MIN("year") FROM "screen_actors_guild" WHERE "result"='won' AND "role_episode"='fox mulder';
## Task Generate a SQL query to answer the following question: `what is the earliest year when the result is won and the role/episode is fox mulder?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "screen_actors_guild" ( "year" real, "category" text, "recipients_and_nominees" text, "role_episode" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `what is the earliest year when the result is won and the role/episode is fox mulder?`: ```sql
SELECT "year" FROM "screen_actors_guild" WHERE "role_episode"='david duchovny';
## Task Generate a SQL query to answer the following question: `what is the year when the role/episode is david duchovny?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "screen_actors_guild" ( "year" real, "category" text, "recipients_and_nominees" text, "role_episode" text, "result" text ); ### SQL Given the database schema, here is the SQL query that answers `what is the year when the role/episode is david duchovny?`: ```sql
SELECT "date" FROM "schedule" WHERE "week"=9;
## Task Generate a SQL query to answer the following question: `What date has 9 as the week?` ### 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 `What date has 9 as the week?`: ```sql
SELECT AVG("total") FROM "single_game" WHERE "tally"='0-8';
## Task Generate a SQL query to answer the following question: `What is the average total of the 0-8 tally?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "single_game" ( "rank" real, "player" text, "county" text, "tally" text, "total" real, "opposition" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the average total of the 0-8 tally?`: ```sql
SELECT COUNT("rank") FROM "single_game" WHERE "opposition"='tipperary';
## Task Generate a SQL query to answer the following question: `What is the total rank of the match with tipperary as the opposition?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "single_game" ( "rank" real, "player" text, "county" text, "tally" text, "total" real, "opposition" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the total rank of the match with tipperary as the opposition?`: ```sql
SELECT MIN("total") FROM "single_game" WHERE "player"='tommy ring' AND "rank">1;
## Task Generate a SQL query to answer the following question: `What is the lowest total of player tommy ring, who has a rank greater than 1?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "single_game" ( "rank" real, "player" text, "county" text, "tally" text, "total" real, "opposition" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the lowest total of player tommy ring, who has a rank greater than 1?`: ```sql
SELECT AVG("rank") FROM "single_game" WHERE "opposition"='offaly' AND "total">9;
## Task Generate a SQL query to answer the following question: `What is the average rank of the match where offaly was the opposition and the total was greater than 9?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "single_game" ( "rank" real, "player" text, "county" text, "tally" text, "total" real, "opposition" text ); ### SQL Given the database schema, here is the SQL query that answers `What is the average rank of the match where offaly was the opposition and the total was greater than 9?`: ```sql
SELECT "municipality" FROM "municipalities" WHERE "party"='lega friuli-vg' AND "election"<2011;
## Task Generate a SQL query to answer the following question: `Which municipality has a party of Lega Friuli-VG that won elections before 2011?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "municipalities" ( "municipality" text, "inhabitants" real, "mayor" text, "party" text, "election" real ); ### SQL Given the database schema, here is the SQL query that answers `Which municipality has a party of Lega Friuli-VG that won elections before 2011?`: ```sql
SELECT "party" FROM "municipalities" WHERE "mayor"='ettore romoli';
## Task Generate a SQL query to answer the following question: `Which party is Ettore Romoli from?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "municipalities" ( "municipality" text, "inhabitants" real, "mayor" text, "party" text, "election" real ); ### SQL Given the database schema, here is the SQL query that answers `Which party is Ettore Romoli from?`: ```sql
SELECT "campus" FROM "campuses" WHERE "location"='brgy. alangilan, batangas city';
## Task Generate a SQL query to answer the following question: `What campus is in Brgy. Alangilan, Batangas City?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "campuses" ( "campus" text, "executive_director" text, "founded" real, "type" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `What campus is in Brgy. Alangilan, Batangas City?`: ```sql
SELECT "founded" FROM "campuses" WHERE "location"='balayan, batangas';
## Task Generate a SQL query to answer the following question: `When was the Balayan, Batangas campus founded?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "campuses" ( "campus" text, "executive_director" text, "founded" real, "type" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `When was the Balayan, Batangas campus founded?`: ```sql
SELECT "executive_director" FROM "campuses" WHERE "type"='extension' AND "location"='lemery, batangas';
## Task Generate a SQL query to answer the following question: `Who is the executive director of the Lemery, Batangas extension?` ### Database Schema This query will run on a database whose schema is represented in this string: CREATE TABLE "campuses" ( "campus" text, "executive_director" text, "founded" real, "type" text, "location" text ); ### SQL Given the database schema, here is the SQL query that answers `Who is the executive director of the Lemery, Batangas extension?`: ```sql