1sf/bird-sql-train-with-schema huggingface dataset:
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What was the first award won by the cast or crew member of the show? Give the name of the person who won the said award.
Evidence: won refers to result = 'Winner'; first award refers to Min(year)
SQL: SELECT T2.award, T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner' ORDER BY T2.year LIMIT 1;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: In "Sex, Pies and Idiot Scrapes", how many percentage of votes did the 9 star score has?
Evidence: "Sex, Pies and Idiot Scrapes" is the title of episode; 9 star score refers to stars = 9; percentage refers to percent
SQL: SELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Sex, Pies and Idiot Scrapes' AND T2.stars = 9;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List the award name and persons who won the award in 2009.
Evidence: won the award refers to result = 'Winner'; in 2009 refers to year = 2009
SQL: SELECT award, person FROM Award WHERE result = 'Winner' AND SUBSTR(year, 1, 4) = '2009';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Among the casts who were born in Los Angeles, describe the name and birth date of who have 1.8 m and above in height.
Evidence: "Los Angeles" is the birth_place; 1.8 m and above in height refers to height_meters > = 1.8
SQL: SELECT name, birthdate FROM Person WHERE birth_place = 'Los Angeles' AND height_meters >= 1.8;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Provide the episode number, title and rating of which were aired in October, 2008.
Evidence: episode number refers to episode; aired in refers to air_date; October refers to Substr(air_date, 6, 2) = '10': 2008 refers to Substr(air_date, 0, 5) = '2008'
SQL: SELECT episode, title, rating FROM Episode WHERE SUBSTR(air_date, 1, 7) LIKE '2008-10%';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Write down the award ID, award name and winner for character named "Homer simpson 20".
Evidence: "Homer simpson 20" is the character; "Winner" is the result; award name refers to award
SQL: SELECT T1.award_id, T1.award, T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer Simpson' AND T1.result = 'Winner';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List down the award name, result, credit category and credited status of the "Billy Kimball".
Evidence: "Billy Kimball" is the person; award name refers to award; credited category refers to category; credited status refers to credited; credited = 'true' means the person is included in the credit list and vice versa
SQL: SELECT DISTINCT T1.award, T1.result, T2.category, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.person = 'Billy Kimball';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Name the person, award, organization, result and credited status of the assistant director in S20-E13.
Evidence: "assistant director" is the role of person; 'S20-E13' is the episode_id; credited status refers to credited; credited = 'true' means the person is included in the credit list and vice versa
SQL: SELECT T1.person, T1.award, T1.organization, T1.result, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.episode_id = 'S20-E13' AND T2.role = 'assistant director';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Describe the birth country, height and person name who were not included in credit list with category of casting.
Evidence: height refers to height_meters; not in credit list refers to credited = ''; category of casting refers to category = 'Casting Department'
SQL: SELECT T1.birth_country, T1.height_meters, T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Cast' AND T2.credited = 'false';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List the nominee, keywords and episode ID of the title "The Good, the Sad and the Drugly".
Evidence: nominee refers to result = 'Nominee'
SQL: SELECT T3.person, T1.keyword, T1.episode_id FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id WHERE T2.title = 'The Good, the Sad and the Drugly' AND T3.result = 'Nominee';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What is the voting numbers and percentage of the best rating scale of the episode which had keyword of "arab stereotype"?
Evidence: best rating scale refers to stars = 10
SQL: SELECT T2.votes, T2.percent FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.keyword = 'arab stereotype' AND T2.stars = 10;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: For the episode who won the award held by Jupiter Award, describe award name, aired date and rating of that episode.
Evidence: held by Jupiter Award refers to organization = 'Jupiter Award'; won the award refers to result = 'Winner'
SQL: SELECT T1.award, T2.air_date, T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Jupiter Award' AND T1.result = 'Winner';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst.
Evidence: star classification of worst refers to stars = 1; most number of votes refers to MAX(votes)
SQL: SELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Among the episodes with excellent rating which were aired in 2008, describe the title, episode's image, award name and person who were nominated.
Evidence: excellent rating refers to 7 < = rating < = 10; aired in 2008 refers to SUBSTRACT(air_date, 0, 5) = '2008'; who were nominated refers to result = 'Nominee'
SQL: SELECT T2.title, T2.episode_image, T1.award, T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating BETWEEN 7 AND 10 AND SUBSTR(T2.air_date, 1, 4) = '2008' AND T1.result = 'Nominee';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Describe the award title, person and character name of the award ID 326.
SQL: SELECT DISTINCT T1.award, T1.person, T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award_id = 326;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Describe name, birth country, role in episode and age in 2022 of the oldest crew member..
Evidence: age in 2022 refers to SUBTRACT(2022, substr(birthdate, 0, 5)); oldest refers to MIN(birthdate)
SQL: SELECT T1.name, T1.birth_place, T2.role, 2022 - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birthdate IS NOT NULL ORDER BY T1.birthdate LIMIT 1;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Provide the number of credits, category, role and birthplace of the crew member who was born in North Korea.
Evidence: number of credits refers to credited; born in North Korea refers to birth_country = 'North Korea'
SQL: SELECT DISTINCT T2.credited, T2.category, T2.role, T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'North Korea';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Find the winning rate of award in 2010. Describe the winner name, award name, episode title and role of the winner in that episode.
Evidence: in 2010 refers to year = 2010; winning rate refers to DIVIDE(COUNT(result = 'winner'), COUNT(*));
SQL: SELECT T3.rate, T4.person, T4.award, T5.title, T4.role FROM ( SELECT CAST(SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.result IN ('Winner', 'Nominee') THEN 1 ELSE 0 END) AS rate , T1.person, T1.award, T2.title, T1.role FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2010' ) AS T3 INNER JOIN Award AS T4 INNER JOIN Episode AS T5 ON T4.episode_id = T5.episode_id WHERE T4.year = 2010 AND T4.result = 'Winner';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Name the title of the episode that received the highest star score and the highest number of votes.
Evidence: received the highest star score refers to MAX(stars); the highest number of votes refers to MAX(votes)
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What is the total number of awards won by The simpson 20s: Season 20?
Evidence: total number of awards refers to COUNT(award); awards won refers to result = 'Winner';
SQL: SELECT COUNT(award_id) FROM Award WHERE result = 'Winner';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Name the title of the episode that was nominated for Emmy's Outstanding Animated Program 21 times.
Evidence: nominated for refers to result = 'Nominee'; Outstanding Animated Program refers to award = 'Outstanding Animated Program (For Programming Less Than One Hour)'; Emmy's refers to organization = 'Primetime Emmy Awards'; 21 times refers to COUNT(episode_id) = 21;
SQL: SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T1.result = 'Nominee' GROUP BY T1.episode_id HAVING COUNT(T1.episode_id) = 21;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What is the average number of stars assigned to The simpson 20s: S20-E12? What is the said episode all about?
Evidence: average number of stars refers to AVG(stars); simpson 20s: S20-E12 refers to episode_id = 'S20-E12'; episode all about refers to summary
SQL: SELECT AVG(T2.stars), T1.summary FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode_id = 'S20-E12';