db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
simpson_episodes
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 );
Question: what are the titles of the episodes that have received more 7-star votes than the season average? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_...
what are the titles of the episodes that have received more 7-star votes than the season average?
simpson_episodes
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;
Question: what percentage of votes are from the nominated episodes? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, org...
what percentage of votes are from the nominated episodes?
simpson_episodes
select name from person where nickname is not null;
Question: list down person's name who has nickname. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organization, year,...
list down person's name who has nickname.
simpson_episodes
select birth_country from person order by height_meters desc limit 1;
Question: which country has the tallest person in the crew? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organizatio...
which country has the tallest person in the crew?
simpson_episodes
select avg(height_meters) from person where birth_country = 'usa';
Question: what is the average height of people from usa? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organization, ...
what is the average height of people from usa?
simpson_episodes
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;
Question: calculate the percentage of people who were born after 1970 and from california. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname....
calculate the percentage of people who were born after 1970 and from california.
simpson_episodes
select count(name) from person where birth_region != 'connecticut' and birth_country != 'usa';
Question: how many people were not born in connecticut, usa? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organizati...
how many people were not born in connecticut, usa?
simpson_episodes
select title from episode where episode_id in ('s20-e1', 's20-e2', 's20-e3');
Question: list down the title of episode s20-e1, s20-e2 & s20-e3. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organ...
list down the title of episode s20-e1, s20-e2 & s20-e3.
simpson_episodes
select episode_image from episode where episode = 5;
Question: write down the website address which stores the episode image of episode 5. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Awar...
write down the website address which stores the episode image of episode 5.
simpson_episodes
select votes from episode where rating > 7;
Question: state the number of votes for episode with rating of 7 and above. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award...
state the number of votes for episode with rating of 7 and above.
simpson_episodes
select count(*) from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.category = 'casting department';
Question: how many title's crew members are working from casting department? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> awar...
how many title's crew members are working from casting department?
simpson_episodes
select count(*) from person as t1 inner join credit as t2 on t1.name = t2.person where t2.role = 'additional timer' and t1.birth_country = 'usa';
Question: how many additional timers were born in usa? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organization, ye...
how many additional timers were born in usa?
simpson_episodes
select count(*) from person as t1 inner join credit as t2 on t1.name = t2.person where strftime(t1.birthdate) > '1970' and t2.role = 'animation executive producer';
Question: how many people who were born after 1970 are animation executive producer? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award...
how many people who were born after 1970 are animation executive producer?
simpson_episodes
select t1.summary from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.credited = 'false';
Question: write down the summary of episode whereby it has crew members that are not included in the credit list. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, h...
write down the summary of episode whereby it has crew members that are not included in the credit list.
simpson_episodes
select t1.rating from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.person = 'jason bikowski';
Question: list down the rating of episodes that were produced by jason bikowski. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> ...
list down the rating of episodes that were produced by jason bikowski.
simpson_episodes
select avg(t1.height_meters) from person as t1 inner join credit as t2 on t1.name = t2.person where t2.category = 'animation department';
Question: what is the average heights of crew members from animation department? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> ...
what is the average heights of crew members from animation department?
simpson_episodes
select distinct t2.character from award as t1 inner join character_award as t2 on t1.award_id = t2.award_id where t1.award_category = 'primetime emmy' and t1.year = 2009 and t1.result = 'winner';
Question: what is the character that won the award in primetime emmy 2009? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_...
what is the character that won the award in primetime emmy 2009?
simpson_episodes
select t2.character from award as t1 inner join character_award as t2 on t1.award_id = t2.award_id where t1.award_category = 'primetime emmy' and t1.year between 2009 and 2010 and t1.result != 'winner';
Question: what are the characters that were nominated for primetime emmy award from 2009 to 2010 but did not win? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, h...
what are the characters that were nominated for primetime emmy award from 2009 to 2010 but did not win?
simpson_episodes
select sum(t1.votes) from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.person = 'adam kuhlman';
Question: calculate the total votes of episodes that adam kuhlman had involved. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> a...
calculate the total votes of episodes that adam kuhlman had involved.
simpson_episodes
select t1.keyword, t2.person from keyword as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t1.episode_id = 's20-e1';
Question: list down the keyword and crew member's name for episode id s20-e1. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> awa...
list down the keyword and crew member's name for episode id s20-e1.
simpson_episodes
select t1.keyword from keyword as t1 inner join vote as t2 on t1.episode_id = t2.episode_id where t2.stars = 10 and t2.percent > 29;
Question: what is the keyword for episodes with stars score of 10 at 30% and above? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award ...
what is the keyword for episodes with stars score of 10 at 30% and above?
simpson_episodes
select cast(sum(case when t2.stars = 5 then 1 else 0 end) as real) * 100 / count(*) from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t1.title = 'sex, pies and idiot scrapes';
Question: what is the percentage of star score 5 that was collected by title 'sex, pies and idiot scrapes'? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_...
what is the percentage of star score 5 that was collected by title 'sex, pies and idiot scrapes'?
simpson_episodes
select case when t2.keyword = 'limbo dancing' then 'yes' else 'no' end as result from episode as t1 inner join keyword as t2 on t1.episode_id = t2.episode_id where t1.title = 'dangerous curves';
Question: please check is 'limbo dancing' the keyword for title 'dangerous curves'? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award ...
please check is 'limbo dancing' the keyword for title 'dangerous curves'?
simpson_episodes
select t2.title from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t1.award = 'best international tv series' and substr(t1.year, 1, 4) = '2017';
Question: which title is the winner of best international tv series in 2017? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> awar...
which title is the winner of best international tv series in 2017?
simpson_episodes
select t2.keyword from award as t1 inner join keyword as t2 on t2.episode_id = t1.episode_id where t1.award_category = 'wga award (tv)';
Question: write down all the keywords for winner of 'wga award (tv)' award. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award...
write down all the keywords for winner of 'wga award (tv)' award.
simpson_episodes
select t1.birth_place from person as t1 inner join award as t2 on t1.name = t2.person where t2.award = 'outstanding animated program (for programming less than one hour)' and t2.role = 'co-executive producer';
Question: state the birth place of co-executive producer for nominee of 'outstanding animated program (for programming less than one hour)' award. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_plac...
state the birth place of co-executive producer for nominee of 'outstanding animated program (for programming less than one hour)' award.
simpson_episodes
select t2.stars, sum(t2.stars) from award as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t1.award_category = 'blimp award' and t2.stars between 1 and 5 group by t2.stars;
Question: sum up the votes from star 1 to 5 for all of the contestants in blimp award. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Awa...
sum up the votes from star 1 to 5 for all of the contestants in blimp award.
simpson_episodes
select sum(t2.rating) from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t1.award_category in ('jupiter award ', 'wga award (tv)');
Question: calculate the total rating of winners in ofta television award and wga award (tv). | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nicknam...
calculate the total rating of winners in ofta television award and wga award (tv).
simpson_episodes
select sum(t2.percent) from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t1.title = 'no loan again, naturally' and t1.rating = 6.8 and t2.stars between 5 and 10;
Question: out of the rating of 6.8 scored by title 'no loan again, naturally', how many percent of it consists of scores 5 to 10? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, ...
out of the rating of 6.8 scored by title 'no loan again, naturally', how many percent of it consists of scores 5 to 10?
simpson_episodes
select count(distinct episode_id) from vote where stars > 8;
Question: how many episodes have the star score greater than 8? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organiz...
how many episodes have the star score greater than 8?
simpson_episodes
select episode_id from vote order by votes desc limit 1;
Question: which episode has the highest number of vote of the star score? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_i...
which episode has the highest number of vote of the star score?
simpson_episodes
select count(episode_id) from keyword where keyword = '2d animation';
Question: how many episodes have the keyword '2d animation'? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organizati...
how many episodes have the keyword '2d animation'?
simpson_episodes
select organization from award where award_id = 328;
Question: name the organization which hold the award id 328. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organizati...
name the organization which hold the award id 328.
simpson_episodes
select count(award_id) from award where substr(year, 1, 4) = '2009';
Question: how many awards had been held in 2009? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organization, year, aw...
how many awards had been held in 2009?
simpson_episodes
select count(award_id) from award where award_category = 'primetime emmy';
Question: how many awards classified as 'primetime emmy' category? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, orga...
how many awards classified as 'primetime emmy' category?
simpson_episodes
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;
Question: list out the birth name of crews who are co-executive producer and higher than 1.60 meters. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters...
list out the birth name of crews who are co-executive producer and higher than 1.60 meters.
simpson_episodes
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';
Question: calculate the percentage of the nominees who were born in usa. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id...
calculate the percentage of the nominees who were born in usa.
simpson_episodes
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';
Question: calculate the percentage of the winners who are higher than 1.75 meters. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -...
calculate the percentage of the winners who are higher than 1.75 meters.
simpson_episodes
select t1.title from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t2.stars = 2;
Question: list out the title of episodes which have star score of 2. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, or...
list out the title of episodes which have star score of 2.
simpson_episodes
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';
Question: list out the star scores of episode which has title of 'how the test was won'. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. A...
list out the star scores of episode which has title of 'how the test was won'.
simpson_episodes
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;
Question: among the episodes which have star score greater than 5, how many episodes have air date in 2008? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_...
among the episodes which have star score greater than 5, how many episodes have air date in 2008?
simpson_episodes
select t2.character from award as t1 inner join character_award as t2 on t1.award_id = t2.award_id where t1.year = 2009;
Question: list out the names of the awarded character in the awards held in 2009. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award ->...
list out the names of the awarded character in the awards held in 2009.
simpson_episodes
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';
Question: which are the years that character mr. burns won an award? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, or...
which are the years that character mr. burns won an award?
simpson_episodes
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';
Question: what is the awarded category that the awarded character lenny won? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> awar...
what is the awarded category that the awarded character lenny won?
simpson_episodes
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';
Question: what is the name of actor who took the role smithers? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organiz...
what is the name of actor who took the role smithers?
simpson_episodes
select t2.keyword from episode as t1 inner join keyword as t2 on t1.episode_id = t2.episode_id where t1.title = 'dangerous curves';
Question: what are the keywords of the episode which has title as dangerous curves? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award ...
what are the keywords of the episode which has title as dangerous curves?
simpson_episodes
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';
Question: what are the keywords of the episodes which have the air date in 2008? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> ...
what are the keywords of the episodes which have the air date in 2008?
simpson_episodes
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;
Question: among the episodes which have star score less than 8, how many episodes were aired in 2009? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters...
among the episodes which have star score less than 8, how many episodes were aired in 2009?
simpson_episodes
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';
Question: state the birth name of crews who are director and have birth country in south korea. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nick...
state the birth name of crews who are director and have birth country in south korea.
simpson_episodes
select count(award_id) from award where substr(year, 1, 4) = '2009' and result = 'winner';
Question: how many awards did simpson 20 won in 2009? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organization, yea...
how many awards did simpson 20 won in 2009?
simpson_episodes
select count(episode_id) from episode where rating < 7;
Question: what is the total number of episode with a rating below 7? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, or...
what is the total number of episode with a rating below 7?
simpson_episodes
select name from person where birth_region = 'california' and birth_country = 'usa';
Question: list down the names of person born in california, usa. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organi...
list down the names of person born in california, usa.
simpson_episodes
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';
Question: in between the episode 5 and10 of season 2, how many of them are credited for casting? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nic...
in between the episode 5 and10 of season 2, how many of them are credited for casting?
simpson_episodes
select episode_id from vote where stars = 2 and votes = 9;
Question: what is the episode id that received 2 stars and 9 votes? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, org...
what is the episode id that received 2 stars and 9 votes?
simpson_episodes
select t2.title from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t1.organization = 'primetime emmy awards' and t1.year = 2009 and t1.result = 'winner';
Question: give the title of the episode won in primetime emmy awards 2009. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_...
give the title of the episode won in primetime emmy awards 2009.
simpson_episodes
select distinct 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' and t2.stars < 5;
Question: list down the episode id of episodes aired in 2008 with 5 stars and below. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award...
list down the episode id of episodes aired in 2008 with 5 stars and below.
simpson_episodes
select t2.category from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.person = 'carlton batten' and t2.credited = 'true' order by t1.votes desc limit 1;
Question: among the episode with highest votes, what is the category credited to carlton batten? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nic...
among the episode with highest votes, what is the category credited to carlton batten?
simpson_episodes
select t2.percent from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where substr(t1.air_date, 1, 4) = '2008' and t1.votes between 950 and 960;
Question: among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, ni...
among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.
simpson_episodes
select t1.episode_id, t1.title from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.credited = 'true' and t2.person = 'bonita pietila' and t2.role = 'casting';
Question: list the episode id and title of episode where casting was credited to bonita pietila. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nic...
list the episode id and title of episode where casting was credited to bonita pietila.
simpson_episodes
select count(*) from award as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t1.organization = 'annie awards' and t1.result = 'nominee' and t2.percent > 6;
Question: in episode nominated in annie awards, how many of the episodes have a percent greater than 6? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_mete...
in episode nominated in annie awards, how many of the episodes have a percent greater than 6?
simpson_episodes
select distinct t2.title from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t2.votes > 1000 and t1.award_category = 'wga award (tv)' and t1.result = 'nominee';
Question: what is the title of episode nominated for wga award (tv) with votes greater than 1000? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, ni...
what is the title of episode nominated for wga award (tv) with votes greater than 1000?
simpson_episodes
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.role = 'additional timer' and t2.credited = 'true' and t2.category = 'animation department';
Question: among the people in animation department, who are credited for additional time in the episode titled by 'how the test was won'? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_...
among the people in animation department, who are credited for additional time in the episode titled by 'how the test was won'?
simpson_episodes
select t2.stars from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where substr(t1.air_date, 1, 7) = '2008-11';
Question: list the stars of episodes aired in november 2008. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickname. Award -> award_id, organizati...
list the stars of episodes aired in november 2008.
simpson_episodes
select t3.title 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 t3.air_date = '2009-04-19' and t1.award_category = 'prism award' and t2.stars = 5 and t1.result = 'nominee';
Question: what is the title of episode with 5 stars and nominated for prism award which is aired on april 19, 2009? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country,...
what is the title of episode with 5 stars and nominated for prism award which is aired on april 19, 2009?
simpson_episodes
select t1.award_category from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t1.result = 'nominee' order by t2.votes desc limit 1;
Question: in episode with the highest votes, list the category of awards it is nominated for. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, nickna...
in episode with the highest votes, list the category of awards it is nominated for.
simpson_episodes
select count(*) from episode as t1 inner join credit as t2 on t1.episode_id = t2.episode_id where t2.credited = 'true' and t2.person = 'sam im' and substr(t1.air_date, 1, 4) = '2009' and t2.role = 'additional timer';
Question: in episodes aired in 2009, how many of them are credited to sam im for additional timer? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters, n...
in episodes aired in 2009, how many of them are credited to sam im for additional timer?
simpson_episodes
select distinct t1.title from episode as t1 inner join vote as t2 on t2.episode_id = t1.episode_id where t2.stars > 0.7 * ( select avg(stars) from vote );
Question: list the title of the episode with stars greater than the 70% of average stars of all episodes. | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_me...
list the title of the episode with stars greater than the 70% of average stars of all episodes.
simpson_episodes
select cast((sum(case when t1.result = 'nominee' then 1 else 0 end) - sum(case when t1.result = 'winner' then 1 else 0 end)) as real) * 100 / count(t1.result) from award as t1 inner join episode as t2 on t1.episode_id = t2.episode_id where t2.title = 'gone maggie gone' and t1.year = 2009;
Question: in year 2009, what is the percentage of the episode titled by 'gone maggie gone' being nominated? | Tables: Episode -> episode_id, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Person -> name, birthdate, birth_name, birth_place, birth_region, birth_country, height_...
in year 2009, what is the percentage of the episode titled by 'gone maggie gone' being nominated?
student_loan
select count(name) from longest_absense_from_school where `month` = 0
Question: how many students have never been absent from school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joi...
how many students have never been absent from school?
student_loan
select max(month) from longest_absense_from_school
Question: for the students who have been absent from school for the longest time, how many months have they been absent? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. u...
for the students who have been absent from school for the longest time, how many months have they been absent?
student_loan
select count(name) from enlist where organ = 'navy'
Question: how many students belong to the navy department? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: d...
how many students belong to the navy department?
student_loan
select count(t1.name) from longest_absense_from_school as t1 inner join male as t2 on t1.`name` = t2.`name` where t1.`month` >= 5
Question: among the students that have been absent from school for more than 5 months, how many of them are male? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemploy...
among the students that have been absent from school for more than 5 months, how many of them are male?
student_loan
select t1.name from enlist as t1 inner join male as t2 on t1.`name` = t2.`name` where t1.organ = 'navy'
Question: please list the names of the male students that belong to the navy department. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> n...
please list the names of the male students that belong to the navy department.
student_loan
select count(t1.name) from filed_for_bankrupcy as t1 inner join longest_absense_from_school as t2 on t1.`name` = t2.`name` where t2.`month` > 5
Question: among the students that have filed for bankruptcy, how many of them have been absent from school for over 5 months? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bo...
among the students that have filed for bankruptcy, how many of them have been absent from school for over 5 months?
student_loan
select count(t1.name) from enlist as t1 inner join no_payment_due as t2 on t1.`name` = t2.`name` where t1.organ = 'navy' and t2.bool = 'pos'
Question: among the students from the navy department, how many of them have payment due? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> ...
among the students from the navy department, how many of them have payment due?
student_loan
select t1.name, t2.name, t3.name from disabled as t1 inner join male as t2 on t1.`name` = t2.`name` inner join filed_for_bankrupcy as t3 on t1.`name` = t3.`name`
Question: please list the male students that are disabled and have filed for bankruptcy. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> n...
please list the male students that are disabled and have filed for bankruptcy.
student_loan
select count(name) from disabled where name not in ( select name from male )
Question: how many female students are disabled? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.na...
how many female students are disabled?
student_loan
select count(t1.name) from unemployed as t1 inner join no_payment_due as t2 on t1.`name` = t2.`name`
Question: how many students are unemployed and have payment due? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Jo...
how many students are unemployed and have payment due?
student_loan
select t1.month from longest_absense_from_school as t1 inner join enlist as t2 on t1.`name` = t2.`name` where t2.organ = 'navy' order by t1.`month` desc limit 1
Question: what is the longest time for a student from the navy department to be absent from school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. en...
what is the longest time for a student from the navy department to be absent from school?
student_loan
select count(t1.name) from longest_absense_from_school as t1 inner join disabled as t2 on t1.`name` = t2.`name` where t1.`month` = 0
Question: how many disabled students have never been absent from school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mon...
how many disabled students have never been absent from school?
student_loan
select t2.organ from longest_absense_from_school as t1 inner join enlist as t2 on t1.`name` = t2.`name` where t1.`month` = 9
Question: please list the departments the students are absent from school for 9 months are in. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolle...
please list the departments the students are absent from school for 9 months are in.
student_loan
select t2.organ, count(t1.name) from disabled as t1 inner join enlist as t2 on t1.`name` = t2.`name` group by t2.organ order by count(t1.name) desc limit 1
Question: which department has the most disabled students? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: d...
which department has the most disabled students?
student_loan
select name from filed_for_bankrupcy where name not in ( select name from male )
Question: please list all the female students that have filed for bankruptcy. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school...
please list all the female students that have filed for bankruptcy.
student_loan
select cast(count(t2.name) as real) * 100 / count(t1.name) from enlist as t1 left join male as t2 on t1.`name` = t2.`name` where t1.organ = 'navy'
Question: what is the percentage of male students in the navy department? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mo...
what is the percentage of male students in the navy department?
student_loan
select avg(t1.month) from longest_absense_from_school as t1 inner join disabled as t2 on t1.`name` = t2.`name`
Question: what is the average time for a disabled student to be absent from school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, ...
what is the average time for a disabled student to be absent from school?
student_loan
select name from enlist where organ = 'foreign_legion'
Question: name all students enlisted in the foreign legion. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: ...
name all students enlisted in the foreign legion.
student_loan
select bool from no_payment_due where name = 'student348'
Question: does student348 have a due payment? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.name ...
does student348 have a due payment?
student_loan
select school from enrolled where name = 'student829'
Question: which school is student829 enrolled in? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.n...
which school is student829 enrolled in?
student_loan
select month from longest_absense_from_school where name = 'student217'
Question: how many months has student217 been absent? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabl...
how many months has student217 been absent?
student_loan
select name from longest_absense_from_school where `month` = 6
Question: list all students that have been absent for 6 months. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joi...
list all students that have been absent for 6 months.
student_loan
select organ from enlist where name = 'student285'
Question: which organization did student285 enlist? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled...
which organization did student285 enlist?
student_loan
select t2.name, t1.school from enrolled as t1 inner join disabled as t2 on t1.`name` = t2.`name` where t1.name = 'student281'
Question: is student281 disabled and which school is the student enrolled in? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school...
is student281 disabled and which school is the student enrolled in?
student_loan
select t1.name, t1.school from enrolled as t1 inner join enlist as t2 on t1.`name` = t2.`name` where t2.organ = 'air_force'
Question: list all students in the air force and which school they were enrolled at. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name,...
list all students in the air force and which school they were enrolled at.
student_loan
select t1.name from no_payment_due as t1 inner join person as t2 on t1.`name` = t2.`name` where t2.`name` not in ( select name from male ) and t1.bool = 'neg'
Question: list 10 students that have no due payments and are not males. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mont...
list 10 students that have no due payments and are not males.
student_loan
select t2.organ, t1.name from no_payment_due as t1 inner join enlist as t2 on t1.`name` = t2.`name` where t1.bool = 'pos' limit 5
Question: name 5 students with due payments that are enlisted alongside which organization they were enlisted. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed ...
name 5 students with due payments that are enlisted alongside which organization they were enlisted.
student_loan
select t2.name from enrolled as t1 inner join disabled as t2 on t1.`name` = t2.`name` where t1.school = 'smc'
Question: name all disabled students that are enrolled in smc. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Join...
name all disabled students that are enrolled in smc.
student_loan
select t2.name from enlist as t1 inner join filed_for_bankrupcy as t2 on t1.`name` = t2.`name` where t1.organ = 'foreign_legion'
Question: which students that filed for bankruptcy are also in the foreign legion? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, s...
which students that filed for bankruptcy are also in the foreign legion?
student_loan
select count(t1.name) from no_payment_due as t1 inner join male as t2 on t1.name = t2.name where t1.bool = 'neg'
Question: how many male students have no due payments? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disab...
how many male students have no due payments?
student_loan
select t1.name from longest_absense_from_school as t1 inner join enlist as t2 on t1.`name` = t2.`name` where t2.organ = 'marines' and t1.`month` = 6
Question: which students that are in the marines have been absent for 6 months? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, scho...
which students that are in the marines have been absent for 6 months?
student_loan
select t2.name from enrolled as t1 inner join unemployed as t2 on t1.`name` = t2.`name` where t1.school = 'smc'
Question: how many students from smc are unemployed? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disable...
how many students from smc are unemployed?