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: List the name of persons who were not included in the credit for the 'How the Test Was Won' episode.
Evidence: "How the Test Was Won" is the title of episode; not included in the credit refers to credited = ' '; name of person refers to person
SQL: SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' 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: What is the title of episode that has a keyword of 'riot' and 'cake'?
Evidence: "riot" and "cake" are both keyword
SQL: SELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('riot', 'cake');
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: Which episode has the most vote for 10 stars rating?
Evidence: 10 stars rating refers to stars = 10; most vote refers to Max(votes)
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.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: Name all the person who involved in the making of simpson 20s episode that aired between October to November.
Evidence: aired between October to November refers to strftime('%m', air_date) between '10' and '11';
SQL: SELECT DISTINCT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 6, 2) BETWEEN '10' AND '11';
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: State the name of director for the 'Treehouse of Horror XIX' episode.
Evidence: "Treehouse of Horror XIX" is the title of episode; 'director' is the role of person; name refers to person
SQL: SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Treehouse of Horror XIX' AND T2.role = '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: Based on the credits, state how many roles were played in the 5th episode of simpson 20.
Evidence: 5th episode refers to episode = 5
SQL: SELECT COUNT(DISTINCT T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 5;
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 all the keyword for 'Take My Life, Please' episode.
Evidence: "Take My Life,Please" is the title of episode
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
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 episode that get more than 950 votes, how many of the episodes were nominated for the 'Outstanding Voice-Over Performance Award in 2009'? Find the percentage of the episodes.
Evidence: more than 950 votes refers to votes > 950; in 2009 refers to year = 2009; number of episode = Count(episode_id); nominated refers to result = 'Nominee'; percentage = Divide(Count(award = 'Outstanding Voice-Over Performance'), Count(episode_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.award = 'Outstanding Voice-Over Performance' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 950 AND T1.year = 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: What is the ratio between the 5 stars votes for 'No Loan Again, Naturally' episode and 'Coming to Homerica' episode?
Evidence: 5 stars votes refers to stars = 5 ; 'No Loan Again, Naturally' and 'Coming to Homerica' are both the title of episode;  ratio = Divide (votes where title = 'No Loan Again, Naturally', votes where title = 'Coming to Homerica')
SQL: SELECT CAST(SUM(CASE WHEN T1.title = 'No Loan Again, Naturally' THEN T1.votes ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Coming to Homerica' THEN T1.votes ELSE 0 END) AS ratio FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5;
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: How many times was Ian Maxtone-Graham nominated for an award in Writers Guild of America, USA?
Evidence: "Ian Maxtone-Graham" is the person; nominated refers to result = 'Nominee'; 'Writers Guild of America, USA' is the organization
SQL: SELECT COUNT(award_id) FROM Award WHERE person = 'Ian Maxtone-Graham' AND organization = 'Writers Guild of America, USA' AND 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 name of the person that has the highest number of nominated award but didn't win?
Evidence: nominated refers to result = 'Nominee'; highest number of nominated award refers to Max(Count(person))
SQL: SELECT person FROM Award WHERE result = 'Nominee' GROUP BY person ORDER BY COUNT(person) 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 title of the episode that received the lowest rating?
Evidence: lowest rating refers to Min(rating)
SQL: SELECT title FROM Episode ORDER BY rating 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 year did the Simpsons receive its first ever award for Favorite Animated Comedy in People's Choice Award?
Evidence: "Favorite Animated Comedy" is the award; 'People's Choice Award' is the award_category; received award refers to result = 'Winner'; first ever award refers to Min(year)
SQL: SELECT year FROM Award WHERE result = 'Winner' AND award = 'Favorite Animated Comedy' ORDER BY year 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: How many episodes was Dell Hake not included in the credit list?
Evidence: "Dell Hake" is the person; not included in the credit list refers to credited = ''
SQL: SELECT COUNT(*) FROM Credit WHERE person = 'Dell Hake' AND 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: How old was the awardee when he/she won the first-ever award for Outstanding Voice-Over Performance in Primetime Emmy Awards?
Evidence: "Outstanding Voice-Over Performance" is the award; 'Primetime Emmy Awards' is the organization; awardee refers to result = 'Winner'; first ever award refers to Min(year); age at the time of awarded refers to Subtract(year, SUBSTR(birthdate, 0, 5))
SQL: SELECT T2.year - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.organization = 'Primetime Emmy Awards' AND T2.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: What character did Dan Castellaneta play that won him an award for Outstanding Voice-Over Performance in 2009 in the Primetime Emmy Awards?
Evidence: "Dan Castellaneta" is the person; won refers to result = 'Winner'; 'Outstanding Voice-Over Performance' is the award; 'Primetime Emmy Awards' is the organization; in 2009 refers to year = 2009
SQL: SELECT DISTINCT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.person = 'Dan Castellaneta' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.organization = 'Primetime Emmy Awards' AND T1.year = 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 episodes aired on April of 2009, how many episodes won an award?
Evidence: aired on refers to air_date, April refers to SUBSTR(air_date, 6, 2) = '04'; 2009 refers to SUBSTR (air_date, 0, 5) = '2009'
SQL: SELECT COUNT(T1.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 T2.air_date LIKE '2009-04%';
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 birth place of the cast or crew member who won the Best Voice-Over Performance in Online Film & Television Association in 2009?
Evidence: won refers to result = 'Winner'; 'Best Voice-Over Performance' is the award; ' Online Film & Television Association' is the organization; in 2009 refers to year = 2009
SQL: SELECT T1.birth_place FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Best Voice-Over Performance' AND T2.organization = 'Online Film & Television Association' AND T2.year = 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: How many 10 star votes did the top 4 episodes with the highest rating received?
Evidence: 10 stars votes refers to stars = 10; highest rating refers to Max(rating); number of votes refers to SUM(votes)
SQL: SELECT SUM(T1.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.rating DESC LIMIT 4;
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 "No Loan Again, Naturally", how many stars received votes of no more than 50?
Evidence: "No Loan Again, Naturally" is the title of episode; votes of no more than 50 refers to votes < 50; number of stars refers to SUM(stars)
SQL: SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'No Loan Again, Naturally' AND T2.votes < 50;
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: How many award winners are from the USA?
Evidence: award winner refers to result = 'Winner'; 'USA' is the birth_country
SQL: SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'USA' AND T2.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: In Season 20 Episode 11, how many times was Doofus included in the credit list?
Evidence: in Season 20 Episode 11 refers to episode_id = 'S20-E11'; 'Doofus' is the nickname of person; include in credit list refers to credited = 'true'
SQL: SELECT COUNT(*) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'Doofus' AND T2.credited = 'true' AND T2.episode_id = 'S20-E11';