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: How many episodes have the star score greater than 8?
Evidence: star score greater than 8 refers to stars > 8
SQL: SELECT COUNT(DISTINCT episode_id) FROM Vote WHERE stars > 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: Which episode has the highest number of vote of the star score?
Evidence: highest number of vote of the star score refers to max(votes)
SQL: SELECT episode_id FROM Vote ORDER BY 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: How many episodes have the keyword "2d animation"?
SQL: SELECT COUNT(episode_id) FROM Keyword WHERE keyword = '2d animation';
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 organization which hold the award id 328.
SQL: SELECT organization FROM Award WHERE award_id = 328;
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 awards had been held in 2009?
Evidence: had been held in 2009 refers to year = 2009
SQL: SELECT COUNT(award_id) FROM Award WHERE 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: How many awards classified as "Primetime Emmy" category?
Evidence: category refers to award_category
SQL: SELECT COUNT(award_id) FROM Award WHERE award_category = 'Primetime Emmy';
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 out the birth name of crews who are co-executive producer and higher than 1.60 meters.
Evidence: co-executive producer refers to role = 'co-executive producer'; higher than 1.60 meters refers to height_meters > 1.60
SQL: SELECT T1.birth_name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.role = 'co-executive producer' AND T1.height_meters > 1.60;
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 the nominees who were born in USA.
Evidence: nominees refers to result = 'Nominee'; born in USA refers to birth_country = 'USA'; percentage = divide(sum(result = 'Nominee' and birth_country = 'USA'), count(Person.name)) * 100%
SQL: SELECT 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.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: Calculate the percentage of the winners who are higher than 1.75 meters.
Evidence: winners refers to result = 'Winner'; higher than 1.75 meters refers to height_meters > 1.75; percentage = divide(sum(result = 'Winner' and height_meters > 1.75), count(result = 'Winner' )) * 100%

SQL: SELECT CAST(SUM(CASE WHEN T1.height_meters > 1.75 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.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 out the title of episodes which have star score of 2.
Evidence: star score of 2 refers to stars = 2
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 2;
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 out the star scores of episode which has title of "How the Test Was Won".
Evidence: star scores refers to stars
SQL: SELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'How the Test Was Won';
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 which have star score greater than 5, how many episodes have air date in 2008?
Evidence: star score greater than 5 refers to stars > 5; have air date in 2008 refers to air_date LIKE '2008%'
SQL: SELECT COUNT(DISTINCT T2.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE strftime('%Y', T1.air_date) = '2008' AND 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: List out the names of the awarded character in the awards held in 2009.
Evidence: in 2009 refers to year = 2009; name of awarded character refers to character


SQL: SELECT T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE 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: Which are the years that character Mr. Burns won an award?
SQL: SELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Mr. Burns';
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 awarded category that the awarded character Lenny won?
Evidence: 

awarded category refers to award_category
SQL: SELECT DISTINCT T1.award_category FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Lenny';
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 actor who took the role Smithers?
Evidence: name refers to person; the role Smithers refers to character = 'Smithers'
SQL: SELECT DISTINCT T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Smithers';
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 episode which has title as Dangerous Curves?
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Dangerous Curves';
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 episodes which have the air date in 2008?
Evidence: have air date in 2008 refers to air_date LIKE '2008%'
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008';
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 which have star score less than 8, how many episodes were aired in 2009?
Evidence: star score less than 8 refers to stars < 8; aired in 2009 refers to air_date LIKE '2009%'
SQL: SELECT COUNT(DISTINCT T2.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE strftime('%Y', T1.air_date) = '2009' AND T2.stars < 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: State the birth name of crews who are director and have birth country in South Korea.
Evidence: director refers to role = 'director'
SQL: SELECT T1.birth_name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.role = 'director' AND T1.birth_country = 'South 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: How many awards did simpson 20 won in 2009?
Evidence: won refers to result = 'Winner'; in 2009 refers to year = 2009
SQL: SELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009' AND 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 total number of episode with a rating below 7?
Evidence: rating below 7 refers to rating < 7
SQL: SELECT COUNT(episode_id) FROM Episode WHERE rating < 7;
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 names of person born in California, USA.
Evidence: California refers to birth_region = 'California'; USA refers to birth_country = 'USA'
SQL: SELECT name FROM Person WHERE birth_region = 'California' AND 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: In between the episode 5 and10 of season 2, how many of them are credited for casting?
Evidence: between the episode 5 and 10 of season 20 refers to episode_id IN('S20-E5', 'S20-E6', 'S20-E7', 'S20-E8', 'S20-E9', 'S20-E10'); credited refers to credited = 'true'; for casting refers to role = 'casting'
SQL: SELECT COUNT(credited) FROM Credit WHERE episode_id IN ( 'S20-E5',  'S20-E6',  'S20-E7',  'S20-E8',  'S20-E9',  'S20-E10' ) AND credited = 'true' AND role = 'casting';
Database: simpson_episodes
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 episode ID that received 2 stars and 9 votes?
Evidence: 2 stars refers to stars = 2; 9 votes refers to votes = 9
SQL: SELECT episode_id FROM Vote WHERE stars = 2 AND votes = 9;