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 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
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 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
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 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
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 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
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: 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
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 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
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 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
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 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
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 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
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 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
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: 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
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 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
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 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
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 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
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: 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
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 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
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 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
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 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
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 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
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 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
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 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
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 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
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 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
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: 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;