Chinastark/bird_dataset huggingface dataset:
Database: simpson_episodes
Question: How many episodes were aired between October and November 2008?
Evidence: between October and November 2008 refers to air_date BETWEEN '2008-10-01' and '2008-11-30'
SQL: SELECT COUNT(episode_id) FROM Episode WHERE air_date LIKE '2008-10%' OR air_date LIKE '2008-11%';
Database: simpson_episodes
Question: Among episodes aired in 2009, which episode has received the worst response based on the rating.
Evidence: aired in 2009 refers to year(air_date) = 2009; received the worst response based on the rating refers to MIN(rating)
SQL: SELECT episode_id FROM Episode WHERE air_date LIKE '2009%' ORDER BY rating LIMIT 1;
Database: simpson_episodes
Question: List the categories for which Bonita Pietila was given credit and her role in creating the episodes.
SQL: SELECT DISTINCT category, role FROM Credit WHERE person = 'Bonita Pietila';
Database: simpson_episodes
Question: Who from The simpson 20s: Season 20 cast and crew was born in October 29, 1957 in Chicago, Illinois?
Evidence: born in October 29, 1957 refers to birthdate = '1957-10-29'; in Chicago refers to birth_place = 'Chicago'; Illinois refers to birth_region = 'Illinois'
SQL: SELECT name FROM Person WHERE birthdate = '1957-10-29' AND birth_place = 'Chicago' AND birth_region = 'Illinois';
Database: simpson_episodes
Question: Who produced The simpson 20s: Season 20?
Evidence: produced refers to role = 'producer'
SQL: SELECT DISTINCT person FROM Credit WHERE role = 'producer';
Database: simpson_episodes
Question: How old was composer of the show when he was nominated for Emmy's Outstanding Music Composition for a Series in 2009. Indicate his full name as well.
Evidence: in 2009 refers to year = 2009; old refers to SUBTRACT(2009, birthdate); composer of the show refers to role = 'composer'; Emmy's refers to organization = 'Primetime Emmy Awards'; nominated refers to result = 'Nominee'; Outstanding Music Composition refers to award = 'Outstanding Music Composition for a Series (Original Dramatic Score)'
SQL: SELECT T1.year - T2.birthdate AS ageIn2009, T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person = T2.name WHERE T1.role = 'composer' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T1.result = 'Nominee' AND T1.year = 2009;
Database: simpson_episodes
Question: Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title.
Evidence: received the most nomination refers to MAX(COUNT(episode_id))
SQL: SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(*) DESC LIMIT 1;
Database: simpson_episodes
Question: Please indicate the birthplace of the crew which name is Dan Castellaneta.
SQL: SELECT birth_place FROM Person WHERE name = 'Dan Castellaneta';
Database: simpson_episodes
Question: How many crews were born in the USA?
Evidence: born in the USA refers to birth_country = 'USA'
SQL: SELECT COUNT(name) FROM Person WHERE birth_country = 'USA';
Database: simpson_episodes
Question: Please list the name of crew that were born before 1970.
Evidence: born before 1970 refers to birthdate < '1970-01-01'
SQL: SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) < '1970';
Database: simpson_episodes
Question: Name of the crew that were born in California, USA between 1958 and 1969.
Evidence: born in California refers to birth_place = 'California'; USA refers to birth_country = 'USA'; between 1958 and 1969 refers to birthdate BETWEEN '1958-01-01' and '1958-12-31'
SQL: SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1958' AND birth_place = 'California' AND birth_country = 'USA';
Database: simpson_episodes
Question: Which episode ids are rated 5 stars and have more than 100 votes?
Evidence: more than 100 votes refers to votes > 100
SQL: SELECT episode_id FROM Vote WHERE stars = 5 AND votes > 100;
Database: simpson_episodes
Question: Please indicate the keywords of the title "Double, Double, Boy in Trouble".
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Double, Double, Boy in Trouble';
Database: simpson_episodes
Question: Among episodes from 10 to 20, which episode has more than 200 votes?
Evidence: episodes from 10 to 20 refers to episode BETWEEN 10 and 20; more than 200 votes refers to COUNT(votes) > 200
SQL: SELECT DISTINCT T1.episode FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode BETWEEN 10 AND 20 AND T2.votes > 200;
Database: simpson_episodes
Question: Please indicate the keywords of the episode that won the Primetime Emmy Award category.
Evidence: Primetime Emmy Award refers to award_category = 'Primetime Emmy'
SQL: SELECT T2.keyword FROM Award AS T1 INNER JOIN Keyword AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy';
Database: simpson_episodes
Question: Who is the recipient of the Primetime Emmy Award with the most votes?
Evidence: Primetime Emmy Award refers to award_category = 'Primetime Emmy'; the most votes refers to MAX(votes)
SQL: SELECT T1.person FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy' ORDER BY T2.votes DESC LIMIT 1;
Database: simpson_episodes
Question: Which episode id did award Outstanding Animated Program (For Programming Less Than One Hour) with an episode star score of 10?
Evidence: star score of 10 refers to stars = 10
SQL: SELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.stars = 10;
Database: simpson_episodes
Question: Please give the name of the director who achieved the Outstanding Animated Program (For Programming Less Than One Hour) award whose episode title is "No Loan Again, Naturally".
Evidence: the director refers to role = 'director'
SQL: SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.role = 'director' AND T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.title = 'No Loan Again, Naturally';
Database: simpson_episodes
Question: Please indicate which writer has an episode star score greater than 5 in 2009.
Evidence: writer refers to role = 'writer'; star score greater than 5 refers to stars > 5; in 2009 refers to year = 2009
SQL: SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.role = 'writer' AND T2.votes > 5;
Database: simpson_episodes
Question: How many WGA Award (TV) award recipients were born in the USA from 2009 to 2010?
Evidence: WGA Award (TV) award refers to award_category = 'WGA Award (TV)'; born in the USA refers to birth_country = 'USA'; from 2009 to 2010 refers to birthdate BETWEEN '2019-01-01' and '2019-12-31'
SQL: SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award_category = 'WGA Award (TV)' AND T1.birth_country = 'USA' AND T2.year BETWEEN 2009 AND 2010;
Database: simpson_episodes
Question: Which episode did the composer win for Outstanding Music Composition for a Series (Original Dramatic Score) with more than 200 votes?
Evidence: more than 200 votes refer to votes > 200; composer refers to role = 'composer'; Outstanding Music Composition for a Series (Original Dramatic Score) refers to award = 'Outstanding Music Composition for a Series (Original Dramatic Score)'
SQL: SELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.role = 'composer' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T2.votes > 200;
Database: simpson_episodes
Question: The person named Al Jean achieved the Primetime Emmy Award category in 2009, which episode did AI Jean achieve?
Evidence: in 2009 refers to year = 2009
SQL: SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Al Jean' AND T1.award_category = 'Primetime Emmy';
Database: simpson_episodes
Question: How much more votes for episode 1 than for episode 5?
Evidence: more votes refers to SUBTRACT(SUM(votes when episode = 1), SUM(votes when episode = 5))
SQL: SELECT SUM(CASE WHEN T1.episode = 1 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T1.episode = 5 THEN T2.votes ELSE 0 END) AS diff FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id;
Database: simpson_episodes
Question: What award did the character Homer simpson 20 achieve in 2009?
Evidence: in 2009 refers to year = 2009
SQL: SELECT DISTINCT T1.award FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T2.character = 'Homer Simpson';
Database: simpson_episodes
Question: How many episodes have won the award for Outstanding Animated Program (Programming Under One Hour) with less than 100 votes? Calculate the percentage of episodes with less than 100 votes out of total episodes.
Evidence: less than 100 votes refers to votes < 100; percentage refers to DIVIDE(COUNT(episode_id when votes < 100), COUNT(episode_id)) * 100%
SQL: SELECT SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Award AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)';
Database: simpson_episodes
Question: How many recipients of the Primetime Emmy Award category that were born in the USA? Find the percentage of Americans in the total number of the country.
Evidence: born in the USA refers to birth_country = 'USA'; recipients refers to person = 'recipients'; percentage refers to DIVIDE(COUNT(birth_country = 'USA'), count(award_id))
SQL: SELECT SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award_category = 'Primetime Emmy' AND T2.person = 'Dan Castellaneta';
Database: simpson_episodes
Question: Please list two people who are the nominees for the "Outstanding Voice-Over Performance" award for season 20.
Evidence: season 20 refers to episode_id LIKE 'S20%'
SQL: SELECT person FROM Award WHERE result = 'Nominee' AND award = 'Outstanding Voice-Over Performance' AND episode_id LIKE 'S20%' LIMIT 2;
Database: simpson_episodes
Question: How many executive producers are the nominees for the award of "Outstanding Animated Program (For Programming Less Than One Hour)"?
Evidence: the nominees refers to result = 'Nominee'; executive producers refers to role = 'executive producer'
SQL: SELECT COUNT(*) FROM Award WHERE role = 'executive producer' AND result = 'Nominee' AND award = 'Outstanding Animated Program (For Programming Less Than One Hour)';
Database: simpson_episodes
Question: In the crew, who was born in 1962 in California?
Evidence: born in 1962 refers to year(birthdate) = 1962; in California refers to birth_region = 'California'
SQL: SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1962' AND birth_region = 'California';
Database: simpson_episodes
Question: How many of the crew members who are taller than 1.70m were born in Canada?
Evidence: taller than 1.70m refers to height_meters > 1.70; born in Canada refers to birth_country = 'Canada'
SQL: SELECT COUNT(name) FROM Person WHERE height_meters > 1.70 AND birth_country = 'Canada';
Database: simpson_episodes
Question: How many people were considered as prospective recipients of the "Animation" award?
Evidence: prospective recipients refers to result = 'Nominee'
SQL: SELECT COUNT(*) FROM Award WHERE award = 'Animation' AND result = 'Nominee';
Database: simpson_episodes
Question: Please list any three episodes that have an excellent rating.
Evidence: an excellent rating refers to 7 < rating < = 10
SQL: SELECT title FROM Episode WHERE rating BETWEEN 7 AND 10 LIMIT 3;
Database: simpson_episodes
Question: What are the top five most popular episodes?
Evidence: most popular episodes refers to MAX(votes)
SQL: SELECT episode_id FROM Episode ORDER BY votes DESC LIMIT 5;
Database: simpson_episodes
Question: Please list the three episodes with the highest number of votes for the worst star rating.
Evidence: highest number of votes refers to MAX(COUNT(votes)); worst star rating refers to stars = 1
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = ( SELECT MIN(stars) FROM Vote ) ORDER BY T2.votes DESC LIMIT 3;
Database: simpson_episodes
Question: What was the character that Dan Castellaneta did the voice over for and was awarded?
Evidence: voice over for and was awarded refers to award like '%Voice-Over%';
SQL: SELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award LIKE '%Voice-Over%' AND T1.person = 'Dan Castellaneta';
Database: simpson_episodes
Question: Please list all of the episodes that aired in 2008 that have the highest number of votes for the maximum star rating.
Evidence: aired in 2008 refers to air_date like '2008%'; highest number of votes refers to MAX(votes); maximum star rating refers to stars = 10
SQL: SELECT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' ORDER BY T2.votes DESC LIMIT 1;
Database: simpson_episodes
Question: What are the keywords of the episode "Take My Life, Please"?
Evidence: episode "Take My Life, Please" refers to title = 'Take My Life, Please'
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Take My Life, Please';
Database: simpson_episodes
Question: Please provide any two episodes' names that have the same keyword of "1930s to 2020s".
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = '1930s to 2020s' LIMIT 2;
Database: simpson_episodes
Question: In 2010, which episode did Joel H. Cohen win an award for?
Evidence: In 2010 refers to year = 2010
SQL: SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2010' AND T1.person = 'Joel H. Cohen';
Database: simpson_episodes
Question: How many votes of 5-star did the episode "Lisa the Drama Queen" receive?
Evidence: episode "Lisa the Drama Queen" refers to title = 'Lisa the Drama Queen';
SQL: SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lisa the Drama Queen' AND T2.stars = 5;
Database: simpson_episodes
Question: What is the number of votes for 10-star for the episode that has the keyword "reference to the fantastic four"?
Evidence: 10-star refers to stars = 10
SQL: SELECT T2.votes FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 AND T1.keyword = 'reference to the fantastic four';
Database: simpson_episodes
Question: What is the difference between the number of votes for 1-star vs. 10-star for the episode "The Burns and the Bees"?
Evidence: 1-star refers to stars = 1; 10-star refers to stars = 10; episode "The Burns and the Bees" refers to title = 'The Burns and the Bees'; difference refers to SUBTRACT(votes when stars = 1, votes when stars = 10)
SQL: SELECT SUM(CASE WHEN T2.stars = 10 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T2.stars = 1 THEN T2.votes ELSE 0 END) AS Difference FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'The Burns and the Bees';
Database: simpson_episodes
Question: What are the keywords of the least popular episode?
Evidence: least popular episode refers to MIN(votes)
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ORDER BY T1.votes LIMIT 1;
Database: simpson_episodes
Question: What are the episodes that have the average rating with more than 20 of 2-star votes?
Evidence: 2-star refers to stars = 2; average rating refers to 5 < rating < = 7; more than 20 of 2-star votes refers to votes > 20
SQL: SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 2 AND T2.votes > 20 AND T1.rating > 5.0 AND T1.rating <= 7.0;
Database: simpson_episodes
Question: Which episode has the largest number of votes?
Evidence: largest number of votes refers to MAX(votes)
SQL: SELECT episode FROM Episode WHERE votes = ( SELECT MAX(votes) FROM Episode );
Database: simpson_episodes
Question: Who is the oldest among all the casts and crews?
Evidence: oldest refers to MIN(birthdate)
SQL: SELECT name FROM Person ORDER BY birthdate ASC LIMIT 1;
Database: simpson_episodes
Question: What are the episodes Oscar Cervantes is credited with?
Evidence: is credited refers to credited = 'true';
SQL: SELECT episode_id FROM Credit WHERE person = 'Oscar Cervantes' AND credited = 'true';
Database: simpson_episodes
Question: What are the roles of the cast and crew from countries other than the USA?
Evidence: from countries other than the USA refers to birth_country ! = 'USA'
SQL: SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country != 'USA';
Database: simpson_episodes
Question: How many 1 star ratings are there in the worst rated episode of the season?
Evidence: worst rated episode refers to MIN(rating)
SQL: SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 1 ORDER BY T1.rating LIMIT 1;
Database: simpson_episodes
Question: Which character did the "Outstanding Voice-Over Performance" winner voice?
Evidence: the "Outstanding Voice-Over Performance" refers to award = 'Outstanding Voice-Over Performance'; winner refers to result = 'Winner';
SQL: SELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.award = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner';
Database: simpson_episodes
Question: What is the summary of the episode in which Emily Blunt is featured in?
SQL: SELECT T1.summary FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Emily Blunt';
Database: simpson_episodes
Question: Who did "The Tiny Canadian" play as in the show?
Evidence: "The Tiny Canadian" refers to nickname = 'The Tiny Canadian'; play as in the show refers to role

SQL: SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'The Tiny Canadian';
Database: simpson_episodes
Question: Among the episodes with an award nominee or winner, which has the highest percent of 5 star votes?
Evidence: highest percent of 5 star votes refers to max(percent) where star = 5
SQL: SELECT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5 ORDER BY T2.percent DESC LIMIT 1;
Database: simpson_episodes
Question: What is the credited cast for the episode "In the Name of the Grandfather"?
Evidence: 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'
SQL: SELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'In the Name of the Grandfather' AND T2.category = 'Cast' AND T2.credited = 'true';
Database: simpson_episodes
Question: List all of the award winners' birth dates.
Evidence: award winner refers to result = 'Winner'
SQL: SELECT T1.birthdate FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner';
Database: simpson_episodes
Question: Who is the writer for the episode with the most 10 star votes?
Evidence: writer refers to role = 'Writer'; most 10 star votes refers to max(votes) where stars = 10
SQL: SELECT T1.person FROM Credit AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.role = 'Writer' AND T2.stars = 10 GROUP BY T1.person ORDER BY COUNT(*) DESC LIMIT 1;
Database: simpson_episodes
Question: What award did the episode that aired on 11/30/2008 win?
Evidence: aired on 11/30/2008 refers to air_date = '11/30/2008'; win refers to result = 'Winner'
SQL: SELECT T1.award FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Winner' AND T2.air_date = '2008-11-30';
Database: simpson_episodes
Question: List all of the information about the music department's casts and crews.
Evidence: information about the music department refers to category = 'Music Department'
SQL: SELECT DISTINCT person, name, birthdate, birth_name, birth_place , birth_region, birth_country, height_meters, nickname FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Music Department';
Database: simpson_episodes
Question: What are the keywords for episode 426 of the series?
Evidence: episode 426 refers to number_in_series = 426
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.number_in_series = 426;
Database: simpson_episodes
Question: What are the titles of the episodes that have received more 7-star votes than the season average?
Evidence: episodes that have received more 7-star votes than the season average refers to votes > DIVIDE(SUM(votes), COUNT(stars = 7))
SQL: SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 7 AND T2.votes > 0.7 * ( SELECT CAST(COUNT(votes) AS REAL) / COUNT(CASE WHEN stars = 7 THEN 1 ELSE 0 END) FROM Vote );
Database: simpson_episodes
Question: What percentage of votes are from the nominated episodes?
Evidence: nominated episodes refers to result = 'Nominee'; percentage of votes = DIVIDE(SUM(result = 'Nominee), SUM(Votes)) as percentage
SQL: SELECT CAST(SUM(CASE WHEN T1.result = 'Nominee' THEN T2.votes ELSE 0 END) AS REAL) * 100 / SUM(T2.votes) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id;
Database: simpson_episodes
Question: List down person's name who has nickname.
Evidence: has nickname refers to nickname is NOT NULL
SQL: SELECT name FROM Person WHERE nickname IS NOT NULL;
Database: simpson_episodes
Question: Which country has the tallest person in the crew?
Evidence: country refers to birth_country; tallest person refers to max(height_meters)
SQL: SELECT birth_country FROM Person ORDER BY height_meters DESC LIMIT 1;
Database: simpson_episodes
Question: What is the average height of people from USA?
Evidence: people from USA refers to birth_country = 'USA'; average height = AVG(height_meters)
SQL: SELECT AVG(height_meters) FROM Person WHERE birth_country = 'USA';
Database: simpson_episodes
Question: Calculate the percentage of people who were born after 1970 and from California.
Evidence: 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%
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
Question: How many people were not born in Connecticut, USA?
Evidence: not born in Connecticut, USA refers to birth_region ! = 'Connecticut' and birth_country ! = 'USA'
SQL: SELECT COUNT(name) FROM Person WHERE birth_region != 'Connecticut' AND birth_country != 'USA';
Database: simpson_episodes
Question: List down the title of episode S20-E1, S20-E2 & S20-E3.
Evidence: episode S20-E1, S20-E2 & S20-E3 refers to episode_id = 'S20-E1' and episode_id = 'S20-E2' and episode_id = 'S20-E3'
SQL: SELECT title FROM Episode WHERE episode_id IN ('S20-E1', 'S20-E2', 'S20-E3');
Database: simpson_episodes
Question: Write down the website address which stores the episode image of episode 5.
Evidence: website address refers to episode_image
SQL: SELECT episode_image FROM Episode WHERE episode = 5;