Chinastark/bird_dataset huggingface dataset:
Database: simpson_episodes
Note: highest percent of 5 star votes refers to max(percent) where star = 5;
Question: Among the episodes with an award nominee or winner, which has the highest percent of 5 star votes?
SQL: SELECT award.episode_id FROM award INNER JOIN vote ON vote.episode_id = award.episode_id WHERE vote.stars = 5 ORDER BY vote.percent DESC LIMIT 1;
Database: simpson_episodes
Note: credited cast refers to category = 'Cast' and  credited = 'true'; episode "In the name of the Grandfather" refers to title = 'In the name of the Grandfather';
Question: What is the credited cast for the episode "In the Name of the Grandfather"?
SQL: SELECT DISTINCT credit.person FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE episode.title = 'In the Name of the Grandfather' AND credit.category = 'Cast' AND credit.credited = 'true';
Database: simpson_episodes
Note: award winner refers to result = 'Winner';
Question: List all of the award winners' birth dates.
SQL: SELECT person.birthdate FROM person INNER JOIN award ON person.name = award.person WHERE award.result = 'Winner';
Database: simpson_episodes
Note: writer refers to role = 'Writer'; most 10 star votes refers to max(votes) where stars = 10;
Question: Who is the writer for the episode with the most 10 star votes?
SQL: SELECT credit.person FROM credit INNER JOIN vote ON credit.episode_id = vote.episode_id WHERE credit.role = 'Writer' AND vote.stars = 10 GROUP BY credit.person ORDER BY count(*) DESC LIMIT 1;
Database: simpson_episodes
Note: aired on 11/30/2008 refers to air_date = '11/30/2008'; win refers to result = 'Winner';
Question: What award did the episode that aired on 11/30/2008 win?
SQL: SELECT award.award FROM award INNER JOIN episode ON award.episode_id = episode.episode_id WHERE award.result = 'Winner' AND episode.air_date = '2008-11-30';
Database: simpson_episodes
Note: information about the music department refers to category = 'Music Department';
Question: List all of the information about the music department's casts and crews.
SQL: SELECT DISTINCT person, name, birthdate, birth_name, birth_place , birth_region, birth_country, height_meters, nickname FROM person INNER JOIN credit ON person.name = credit.person WHERE credit.category = 'Music Department';
Database: simpson_episodes
Note: episode 426 refers to number_in_series = 426;
Question: What are the keywords for episode 426 of the series?
SQL: SELECT keyword.keyword FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.number_in_series = 426;
Database: simpson_episodes
Note: episodes that have received more 7-star votes than the season average refers to votes > DIVIDE(SUM(votes), COUNT(stars = 7));
Question: What are the titles of the episodes that have received more 7-star votes than the season average?
SQL: SELECT DISTINCT episode.episode_id FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE vote.stars = 7 AND vote.votes > 0.7 * ( SELECT cast(count(votes) AS REAL) / count(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM vote );
Database: simpson_episodes
Note: nominated episodes refers to result = 'Nominee'; percentage of votes = DIVIDE(SUM(result = 'Nominee), SUM(votes)) as percentage;
Question: What percentage of votes are from the nominated episodes?
SQL: SELECT cast(sum(CASE WHEN award.result = 'Nominee' THEN episode.votes ELSE 0 END) AS REAL) * 100 / sum(episode.votes) FROM award INNER JOIN episode ON award.episode_id = episode.episode_id;
Database: simpson_episodes
Note: has nickname refers to nickname is NOT NULL;
Question: List down person's name who has nickname.
SQL: SELECT name FROM person WHERE nickname IS NOT NULL;
Database: simpson_episodes
Note: country refers to birth_country; tallest person refers to max(height_meters);
Question: Which country has the tallest person in the crew?
SQL: SELECT birth_country FROM person ORDER BY height_meters DESC LIMIT 1;
Database: simpson_episodes
Note: people from USA refers to birth_country = 'USA'; average height = AVG(height_meters);
Question: What is the average height of people from USA?
SQL: SELECT avg(height_meters) FROM person WHERE birth_country = 'USA';
Database: simpson_episodes
Note: born after 1970 refers to birthdate > 1970; from California refers to birth_region = 'California'; percentage = divide(count(birthdate > 1970 and birth_region = 'California'), total(birthdate)) * 100%;
Question: Calculate the percentage of people who were born after 1970 and from California.
SQL: SELECT cast(sum(CASE WHEN birth_region = 'California' AND substr(birthdate, 1, 4) > '1970' THEN 1 ELSE 0 END) AS REAL) * 100 / count(birthdate) FROM person;
Database: simpson_episodes
Note: not born in Connecticut, USA refers to birth_region ! = 'Connecticut' and birth_country ! = 'USA';
Question: How many people were not born in Connecticut, USA?
SQL: SELECT count(name) FROM person WHERE birth_region != 'Connecticut' AND birth_country != 'USA';
Database: simpson_episodes
Note: episode S20-E1, S20-E2 & S20-E3 refers to episode_id = 'S20-E1' and episode_id = 'S20-E2' and episode_id = 'S20-E3';
Question: List down the title of episode S20-E1, S20-E2 & S20-E3.
SQL: SELECT title FROM episode WHERE episode_id IN ('S20-E1', 'S20-E2', 'S20-E3');
Database: simpson_episodes
Note: website address refers to episode_image;
Question: Write down the website address which stores the episode image of episode 5.
SQL: SELECT episode_image FROM episode WHERE episode = 5;
Database: simpson_episodes
Note: rating of 7 and above refers to rating > 7.0;
Question: State the number of votes for episode with rating of 7 and above.
SQL: SELECT votes FROM episode WHERE rating > 7;
Database: simpson_episodes
Note: working from Casting Department refers to category = 'Casting Department';
Question: How many title's crew members are working from Casting Department?
SQL: SELECT count(*) FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.category = 'Casting Department';
Database: simpson_episodes
Note: additional timers refers to role = 'additional timer'; born in USA refers to birth_country = 'USA';
Question: How many additional timers were born in USA?
SQL: SELECT count(*) FROM person INNER JOIN credit ON person.name = credit.person WHERE credit.role = 'additional timer' AND person.birth_country = 'USA';
Database: simpson_episodes
Note: born after 1980 refers to birthdate > 1970; assistant to the producers refers to role = 'animation executive producer';
Question: How many people who were born after 1970 are animation executive producer?
SQL: SELECT count(*) FROM person INNER JOIN credit ON person.name = credit.person WHERE strftime(person.birthdate) > '1970' AND credit.role = 'animation executive producer';
Database: simpson_episodes
Note: are not included in the credit list refers to credited = '';
Question: Write down the summary of episode whereby it has crew members that are not included in the credit list.
SQL: SELECT episode.summary FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.credited = 'false';
Database: simpson_episodes
Note: produced by Jason Bikowski refers to person = 'Jason Bikowski';
Question: List down the rating of episodes that were produced by Jason Bikowski.
SQL: SELECT episode.rating FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.person = 'Jason Bikowski';
Database: simpson_episodes
Note: from Animation Department refers to category = 'Animation Department'; AVG(height_meters) where category = 'Animation Department';
Question: What is the average heights of crew members from Animation Department?
SQL: SELECT avg(person.height_meters) FROM person INNER JOIN credit ON person.name = credit.person WHERE credit.category = 'Animation Department';
Database: simpson_episodes
Note: won the award in Primetime Emmy 2009 refers to award_category = 'Primetime Emmy' and year = 2009;
Question: What is the character that won the award in Primetime Emmy 2009?
SQL: SELECT DISTINCT character_award.character FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE award.award_category = 'Primetime Emmy' AND award.year = 2009 AND award.result = 'Winner';
Database: simpson_episodes
Note: nominated for Primetime Emmy award but did not win refers to award_category = 'Primetime Emmy' and result = 'Nominee';  from 2009 to 2010 refers to year >= '2009' and  year <= '2010';
Question: What are the characters that were nominated for Primetime Emmy Award from 2009 to 2010 but did not win?
SQL: SELECT character_award.character FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE award.award_category = 'Primetime Emmy' AND award.year BETWEEN 2009 AND 2010 AND award.result != 'Winner';
Database: simpson_episodes
Note: Adam Kuhlman had involved refers to person = 'Adam Kuhlman';
Question: Calculate the total votes of episodes that Adam Kuhlman had involved.
SQL: SELECT sum(episode.votes) FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.person = 'Adam Kuhlman';
Database: simpson_episodes
Question: List down the keyword and crew member's name for episode id S20-E1.
SQL: SELECT keyword.keyword, credit.person FROM keyword INNER JOIN credit ON keyword.episode_id = credit.episode_id WHERE keyword.episode_id = 'S20-E1';
Database: simpson_episodes
Note: stars score of 10 at 30% and above refers to stars = 10 and percent > 29;
Question: What is the keyword for episodes with stars score of 10 at 30% and above?
SQL: SELECT keyword.keyword FROM keyword INNER JOIN vote ON keyword.episode_id = vote.episode_id WHERE vote.stars = 10 AND vote.percent > 29;
Database: simpson_episodes
Note: percentage = DIVIDE(SUM(stars = 5), COUNT(stars)) as percentage;
Question: What is the percentage of star score 5 that was collected by title "Sex, Pies and Idiot Scrapes"?
SQL: SELECT cast(sum(CASE WHEN vote.stars = 5 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE episode.title = 'Sex, Pies and Idiot Scrapes';
Database: simpson_episodes
Question: Please check is "limbo dancing" the keyword for title "Dangerous Curves"?
SQL: SELECT CASE WHEN keyword.keyword = 'limbo dancing' THEN 'Yes' ELSE 'No' END AS RESULT FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.title = 'Dangerous Curves';
Database: simpson_episodes
Note: winner refers to result = 'Winner'; Best International TV Series in 2017 refers to award = 'Best International TV Series' and year = '2017';
Question: Which title is the winner of Best International TV Series in 2017?
SQL: SELECT episode.title FROM award INNER JOIN episode ON award.episode_id = episode.episode_id WHERE award.award = 'Best International TV Series' AND substr(award.year, 1, 4) = '2017';
Database: simpson_episodes
Note: winner of "WGA award (TV)" award refers to award_category = 'WGA award (TV)' and result = 'Winner';
Question: Write down all the keywords for winner of "WGA Award (TV)" award.
SQL: SELECT keyword.keyword FROM award INNER JOIN keyword ON keyword.episode_id = award.episode_id WHERE award.award_category = 'WGA Award (TV)';
Database: simpson_episodes
Note: co-executive producer refers to role = 'co-executive producer'; nominee of "Outstanding Animated Program (For Programming Less Than One Hour)" award refers to award = 'Outstanding Animated Program (For Programming Less Than One Hour)' and result = 'Nominee';
Question: State the birth place of co-executive producer for nominee of "Outstanding Animated Program (For Programming Less Than One Hour)" award.
SQL: SELECT person.birth_place FROM person INNER JOIN award ON person.name = award.person WHERE award.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND award.role = 'co-executive producer';
Database: simpson_episodes
Note: contestants refers to result = 'Winner' and result = 'Nominee'; in Blimp award refers to award = 'Blimp award'; star 1 to 5 refers to 1 < stars < 5;
Question: Sum up the votes from star 1 to 5 for all of the contestants in Blimp Award.
SQL: SELECT vote.stars, sum(vote.stars) FROM award INNER JOIN vote ON vote.episode_id = award.episode_id WHERE award.award_category = 'Blimp Award' AND vote.stars BETWEEN 1 AND 5 GROUP BY vote.stars;
Database: simpson_episodes
Note: winners refers to result = 'Winner'; in OFTA Television award and WGA award (TV) refers to award = 'OFTA Television award' and award = 'WGA award (TV)';
Question: Calculate the total rating of winners in OFTA Television Award and WGA Award (TV).
SQL: SELECT sum(episode.rating) FROM award INNER JOIN episode ON award.episode_id = episode.episode_id WHERE award.award_category IN ('Jupiter Award ', 'WGA Award (TV)');
Database: simpson_episodes
Note: scores 5 to 10 refers to TOTAL(percent) where 1 <= stars < 5;
Question: Out of the rating of 6.8 scored by title "No Loan Again, Naturally", how many percent of it consists of scores 5 to 10?
SQL: SELECT sum(vote.percent) FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE episode.title = 'No Loan Again, Naturally' AND episode.rating = 6.8 AND vote.stars BETWEEN 5 AND 10;
Database: simpson_episodes
Note: star score greater than 8 refers to stars > 8;
Question: How many episodes have the star score greater than 8?
SQL: SELECT count(DISTINCT episode_id) FROM vote WHERE stars > 8;
Database: simpson_episodes
Note: highest number of vote of the star score refers to max(votes);
Question: Which episode has the highest number of vote of the star score?
SQL: SELECT episode_id FROM vote ORDER BY votes DESC LIMIT 1;
Database: simpson_episodes
Question: How many episodes have the keyword "2d animation"?
SQL: SELECT count(episode_id) FROM keyword WHERE keyword = '2d animation';
Database: simpson_episodes
Question: Name the organization which hold the award id 328.
SQL: SELECT organization FROM award WHERE award_id = 328;
Database: simpson_episodes
Note: had been held in 2009 refers to year = 2009;
Question: How many awards had been held in 2009?
SQL: SELECT count(award_id) FROM award WHERE substr(YEAR, 1, 4) = '2009';
Database: simpson_episodes
Note: category refers to award_category;
Question: How many awards classified as "Primetime Emmy" category?
SQL: SELECT count(award_id) FROM award WHERE award_category = 'Primetime Emmy';
Database: simpson_episodes
Note: co-executive producer refers to role = 'co-executive producer'; higher than 1.60 meters refers to height_meters > 1.60;
Question: List out the birth name of crews who are co-executive producer and higher than 1.60 meters.
SQL: SELECT person.birth_name FROM person INNER JOIN award ON person.name = award.person WHERE award.role = 'co-executive producer' AND person.height_meters > 1.60;
Database: simpson_episodes
Note: nominees refers to result = 'Nominee'; born in USA refers to birth_country = 'USA'; percentage = divide(sum(result = 'Nominee' and birth_country = 'USA'), count(person.name)) * 100%;
Question: Calculate the percentage of the nominees who were born in USA.
SQL: SELECT cast(sum(CASE WHEN person.birth_country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM person INNER JOIN award ON person.name = award.person WHERE award.result = 'Nominee';
Database: simpson_episodes
Note: winners refers to result = 'Winner'; higher than 1.75 meters refers to height_meters > 1.75; percentage = divide(sum(result = 'Winner' and height_meters > 1.75), count(result = 'Winner' )) * 100%;
Question: Calculate the percentage of the winners who are higher than 1.75 meters.
SQL: SELECT cast(sum(CASE WHEN person.height_meters > 1.75 THEN 1 ELSE 0 END) AS REAL) * 100 / count(*) FROM person INNER JOIN award ON person.name = award.person WHERE award.result = 'Winner';
Database: simpson_episodes
Note: star score of 2 refers to stars = 2;
Question: List out the title of episodes which have star score of 2.
SQL: SELECT episode.title FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE vote.stars = 2;
Database: simpson_episodes
Note: star scores refers to stars;
Question: List out the star scores of episode which has title of "How the Test Was Won".
SQL: SELECT vote.stars FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE episode.title = 'How the Test Was Won';
Database: simpson_episodes
Note: star score greater than 5 refers to stars > 5; have air date in 2008 refers to air_date LIKE '2008%';
Question: Among the episodes which have star score greater than 5, how many episodes have air date in 2008?
SQL: SELECT count(DISTINCT vote.episode_id) FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE strftime('%Y', episode.air_date) = '2008' AND vote.stars > 5;
Database: simpson_episodes
Note: in 2009 refers to year = 2009; name of awarded character refers to character;
Question: List out the names of the awarded character in the awards held in 2009.
SQL: SELECT character_award.character FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE award.year = 2009;
Database: simpson_episodes
Question: Which are the years that character Mr. Burns won an award?
SQL: SELECT DISTINCT award.year FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE character_award.character = 'Mr. Burns';
Database: simpson_episodes
Note: awarded category refers to award_category;
Question: What is the awarded category that the awarded character Lenny won?
SQL: SELECT DISTINCT award.award_category FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE character_award.character = 'Lenny';
Database: simpson_episodes
Note: name refers to person; the role Smithers refers to character = 'Smithers';
Question: What is the name of actor who took the role Smithers?
SQL: SELECT DISTINCT award.person FROM award INNER JOIN character_award ON award.award_id = character_award.award_id WHERE character_award.character = 'Smithers';
Database: simpson_episodes
Question: What are the keywords of the episode which has title as Dangerous Curves?
SQL: SELECT keyword.keyword FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE episode.title = 'Dangerous Curves';
Database: simpson_episodes
Note: have air date in 2008 refers to air_date LIKE '2008%';
Question: What are the keywords of the episodes which have the air date in 2008?
SQL: SELECT keyword.keyword FROM episode INNER JOIN keyword ON episode.episode_id = keyword.episode_id WHERE substr(episode.air_date, 1, 4) = '2008';
Database: simpson_episodes
Note: star score less than 8 refers to stars < 8; aired in 2009 refers to air_date LIKE '2009%';
Question: Among the episodes which have star score less than 8, how many episodes were aired in 2009?
SQL: SELECT count(DISTINCT vote.episode_id) FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE strftime('%Y', episode.air_date) = '2009' AND vote.stars < 8;
Database: simpson_episodes
Note: director refers to role = 'director';
Question: State the birth name of crews who are director and have birth country in South Korea.
SQL: SELECT person.birth_name FROM person INNER JOIN award ON person.name = award.person WHERE award.role = 'director' AND person.birth_country = 'South Korea';
Database: simpson_episodes
Note: won refers to result = 'Winner'; in 2009 refers to year = 2009;
Question: How many awards did simpson 20 won in 2009?
SQL: SELECT count(award_id) FROM award WHERE substr(YEAR, 1, 4) = '2009' AND RESULT = 'Winner';
Database: simpson_episodes
Note: rating below 7 refers to rating < 7;
Question: What is the total number of episode with a rating below 7?
SQL: SELECT count(episode_id) FROM episode WHERE rating < 7;
Database: simpson_episodes
Note: California refers to birth_region = 'California'; USA refers to birth_country = 'USA';
Question: List down the names of person born in California, USA.
SQL: SELECT name FROM person WHERE birth_region = 'California' AND birth_country = 'USA';
Database: simpson_episodes
Note: between the episode 5 and 10 of season 20 refers to episode_id IN('S20-E5', 'S20-E6', 'S20-E7', 'S20-E8', 'S20-E9', 'S20-E10'); credited refers to credited = 'true'; for casting refers to role = 'casting';
Question: In between the episode 5 and10 of season 2, how many of them are credited for casting?
SQL: SELECT count(credited) FROM credit WHERE episode_id IN ( 'S20-E5',  'S20-E6',  'S20-E7',  'S20-E8',  'S20-E9',  'S20-E10' ) AND credited = 'true' AND ROLE = 'casting';
Database: simpson_episodes
Note: 2 stars refers to stars = 2; 9 votes refers to votes = 9;
Question: What is the episode ID that received 2 stars and 9 votes?
SQL: SELECT episode_id FROM vote WHERE stars = 2 AND votes = 9;
Database: simpson_episodes
Note: won refers to result = 'Winner'; in Primetime Emmy awards refers to organization = 'Primetime Emmy awards'; 2009 refers to year = 2009;
Question: Give the title of the episode won in Primetime Emmy Awards 2009.
SQL: SELECT episode.title FROM award INNER JOIN episode ON award.episode_id = episode.episode_id WHERE award.organization = 'Primetime Emmy Awards' AND award.year = 2009 AND award.result = 'Winner';
Database: simpson_episodes
Note: aired in 2008 refers to air_date LIKE '2008%'; 5 stars and below refers to stars < 5;
Question: List down the episode ID of episodes aired in 2008 with 5 stars and below.
SQL: SELECT DISTINCT episode.episode_id FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE substr(episode.air_date, 1, 4) = '2008' AND vote.stars < 5;
Database: simpson_episodes
Note: highest votes refers to max(votes); to Carlton Batten refers to person = 'Carlton Batten';
Question: Among the episode with highest votes, what is the category credited to Carlton Batten?
SQL: SELECT credit.category FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.person = 'Carlton Batten' AND credit.credited = 'true' ORDER BY episode.votes DESC LIMIT 1;
Database: simpson_episodes
Note: aired in 2008 refers to air_date LIKE '2008%'; votes ranges from 920 to 950 refers to votes BETWEEN 920 AND 950;
Question: Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.
SQL: SELECT vote.percent FROM episode INNER JOIN vote ON vote.episode_id = episode.episode_id WHERE substr(episode.air_date, 1, 4) = '2008' AND episode.votes BETWEEN 950 AND 960;
Database: simpson_episodes
Note: was credited refers to credited = 'true'; to Bonita Pietila refers to person = 'Bonita Pietila';
Question: List the episode ID and title of episode where casting was credited to Bonita Pietila.
SQL: SELECT episode.episode_id, episode.title FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE credit.credited = 'true' AND credit.person = 'Bonita Pietila' AND credit.role = 'casting';
Database: simpson_episodes
Note: nominated refers to result = 'Nominee'; Annie awards refers to organization = 'Annie awards'; percent greater than 6 refers to percent > 6;
Question: In episode nominated in Annie Awards, how many of the episodes have a percent greater than 6?
SQL: SELECT count(*) FROM award INNER JOIN vote ON vote.episode_id = award.episode_id WHERE award.organization = 'Annie Awards' AND award.result = 'Nominee' AND vote.percent > 6;
Database: simpson_episodes
Note: nominated refers to result = 'Nominee'; WGA award (TV) refers to award_category = 'WGA award (TV)'; votes greater than 1000 refers to votes > 1000;
Question: What is the title of episode nominated for WGA Award (TV) with votes greater than 1000?
SQL: SELECT DISTINCT episode.title FROM award INNER JOIN episode ON award.episode_id = episode.episode_id WHERE episode.votes > 1000 AND award.award_category = 'WGA Award (TV)' AND award.result = 'Nominee';
Database: simpson_episodes
Note: Animation Department refers to category = 'Animation Department'; credited refers to credited = 'true'; for additional timer refers to role = 'additional timer';
Question: Among the people in Animation Department, who are credited for additional time in the episode titled by "How the Test Was Won"?
SQL: SELECT credit.person FROM episode INNER JOIN credit ON episode.episode_id = credit.episode_id WHERE episode.title = 'How the Test Was Won' AND credit.role = 'additional timer' AND credit.credited = 'true' AND credit.category = 'Animation Department';