problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: What are the episodes Oscar Cervantes is credited with?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT episode_id FROM Credit WHERE person = 'Oscar Cervantes' AND credited = 'true';
Write SQL query to solve given problem: What are the roles of the cast and crew from countries other than the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country != 'USA';
Write SQL query to solve given problem: How many 1 star ratings are there in the worst rated episode of the season?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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;
Write SQL query to solve given problem: Which character did the "Outstanding Voice-Over Performance" winner voice?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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 = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner';
Write SQL query to solve given problem: What is the summary of the episode in which Emily Blunt is featured in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT T1.summary FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Emily Blunt';
Write SQL query to solve given problem: Who did "The Tiny Canadian" play as in the show?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.nickname = 'The Tiny Canadian';
Write SQL query to solve given problem: Among the episodes with an award nominee or winner, which has the highest percent of 5 star votes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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;
Write SQL query to solve given problem: What is the credited cast for the episode "In the Name of the Grandfather"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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';
Write SQL query to solve given problem: List all of the award winners' birth dates.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT T1.birthdate FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner';
Write SQL query to solve given problem: Who is the writer for the episode with the most 10 star votes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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;
Write SQL query to solve given problem: What award did the episode that aired on 11/30/2008 win?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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';
Write SQL query to solve given problem: List all of the information about the music department's casts and crews.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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';
Write SQL query to solve given problem: What are the keywords for episode 426 of the series?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
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;
Write SQL query to solve given problem: What are the titles of the episodes that have received more 7-star votes than the season average?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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 );
Write SQL query to solve given problem: What percentage of votes are from the nominated episodes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: List down person's name who has nickname.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT name FROM Person WHERE nickname IS NOT NULL;
Write SQL query to solve given problem: Which country has the tallest person in the crew?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT birth_country FROM Person ORDER BY height_meters DESC LIMIT 1;
Write SQL query to solve given problem: What is the average height of people from USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT AVG(height_meters) FROM Person WHERE birth_country = 'USA';
Write SQL query to solve given problem: Calculate the percentage of people who were born after 1970 and from California.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: How many people were not born in Connecticut, USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(name) FROM Person WHERE birth_region != 'Connecticut' AND birth_country != 'USA';
Write SQL query to solve given problem: List down the title of episode S20-E1, S20-E2 & S20-E3.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT title FROM Episode WHERE episode_id IN ('S20-E1', 'S20-E2', 'S20-E3');
Write SQL query to solve given problem: Write down the website address which stores the episode image of episode 5.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT episode_image FROM Episode WHERE episode = 5;
Write SQL query to solve given problem: State the number of votes for episode with rating of 7 and above.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT votes FROM Episode WHERE rating > 7;
Write SQL query to solve given problem: How many title's crew members are working from Casting Department?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: How many additional timers were born in USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: How many people who were born after 1970 are animation executive producer?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Write down the summary of episode whereby it has crew members that are not included in the credit list.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List down the rating of episodes that were produced by Jason Bikowski.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the average heights of crew members from Animation Department?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the character that won the award in Primetime Emmy 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What are the characters that were nominated for Primetime Emmy Award from 2009 to 2010 but did not win?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Calculate the total votes of episodes that Adam Kuhlman had involved.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List down the keyword and crew member's name for episode id S20-E1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the keyword for episodes with stars score of 10 at 30% and above?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: What is the percentage of star score 5 that was collected by title "Sex, Pies and Idiot Scrapes"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Please check is "limbo dancing" the keyword for title "Dangerous Curves"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Which title is the winner of Best International TV Series in 2017?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Write down all the keywords for winner of "WGA Award (TV)" award.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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)';
Write SQL query to solve given problem: State the birth place of co-executive producer for nominee of "Outstanding Animated Program (For Programming Less Than One Hour)" award.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Sum up the votes from star 1 to 5 for all of the contestants in Blimp Award.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: Calculate the total rating of winners in OFTA Television Award and WGA Award (TV).. Keep the solution inside sql tag ```sql [SQL-Query] ```
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)');
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: How many episodes have the star score greater than 8?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(DISTINCT episode_id) FROM Vote WHERE stars > 8;
Write SQL query to solve given problem: Which episode has the highest number of vote of the star score?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT episode_id FROM Vote ORDER BY votes DESC LIMIT 1;
Write SQL query to solve given problem: How many episodes have the keyword "2d animation"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(episode_id) FROM Keyword WHERE keyword = '2d animation';
Write SQL query to solve given problem: Name the organization which hold the award id 328.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT organization FROM Award WHERE award_id = 328;
Write SQL query to solve given problem: How many awards had been held in 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009';
Write SQL query to solve given problem: How many awards classified as "Primetime Emmy" category?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(award_id) FROM Award WHERE award_category = 'Primetime Emmy';
Write SQL query to solve given problem: List out the birth name of crews who are co-executive producer and higher than 1.60 meters.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: Calculate the percentage of the nominees who were born in USA.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Calculate the percentage of the winners who are higher than 1.75 meters.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List out the title of episodes which have star score of 2.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: List out the star scores of episode which has title of "How the Test Was Won".. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Among the episodes which have star score greater than 5, how many episodes have air date in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: List out the names of the awarded character in the awards held in 2009.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: Which are the years that character Mr. Burns won an award?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the awarded category that the awarded character Lenny won?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the name of actor who took the role Smithers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What are the keywords of the episode which has title as Dangerous Curves?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What are the keywords of the episodes which have the air date in 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Among the episodes which have star score less than 8, how many episodes were aired in 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: State the birth name of crews who are director and have birth country in South Korea.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: How many awards did simpson 20 won in 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(award_id) FROM Award WHERE SUBSTR(year, 1, 4) = '2009' AND result = 'Winner';
Write SQL query to solve given problem: What is the total number of episode with a rating below 7?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT COUNT(episode_id) FROM Episode WHERE rating < 7;
Write SQL query to solve given problem: List down the names of person born in California, USA.. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT name FROM Person WHERE birth_region = 'California' AND birth_country = 'USA';
Write SQL query to solve given problem: In between the episode 5 and10 of season 2, how many of them are credited for casting?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the episode ID that received 2 stars and 9 votes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
simpson_episodes
SELECT episode_id FROM Vote WHERE stars = 2 AND votes = 9;
Write SQL query to solve given problem: Give the title of the episode won in Primetime Emmy Awards 2009.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List down the episode ID of episodes aired in 2008 with 5 stars and below.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: Among the episode with highest votes, what is the category credited to Carlton Batten?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: List the episode ID and title of episode where casting was credited to Bonita Pietila.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: In episode nominated in Annie Awards, how many of the episodes have a percent greater than 6?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: What is the title of episode nominated for WGA Award (TV) with votes greater than 1000?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: Among the people in Animation Department, who are credited for additional time in the episode titled by "How the Test Was Won"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List the stars of episodes aired in November 2008.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: What is the title of episode with 5 stars and nominated for Prism Award which is aired on April 19, 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: In episode with the highest votes, list the category of awards it is nominated for.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: In episodes aired in 2009, how many of them are credited to Sam Im for additional timer?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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';
Write SQL query to solve given problem: List the title of the episode with stars greater than the 70% of average stars of all episodes.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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 );
Write SQL query to solve given problem: In year 2009, what is the percentage of the episode titled by "Gone Maggie Gone" being nominated?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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;
Write SQL query to solve given problem: How many students have never been absent from school?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT COUNT(name) FROM longest_absense_from_school WHERE `month` = 0
Write SQL query to solve given problem: For the students who have been absent from school for the longest time, how many months have they been absent?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT MAX(month) FROM longest_absense_from_school
Write SQL query to solve given problem: How many students belong to the navy department?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT COUNT(name) FROM enlist WHERE organ = 'navy'
Write SQL query to solve given problem: Among the students that have been absent from school for more than 5 months, how many of them are male?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: Please list the names of the male students that belong to the navy department.. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT T1.name FROM enlist AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy'
Write SQL query to solve given problem: Among the students that have filed for bankruptcy, how many of them have been absent from school for over 5 months?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: Among the students from the navy department, how many of them have payment due?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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'
Write SQL query to solve given problem: Please list the male students that are disabled and have filed for bankruptcy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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`
Write SQL query to solve given problem: How many female students are disabled?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT COUNT(name) FROM disabled WHERE name NOT IN ( SELECT name FROM male )
Write SQL query to solve given problem: How many students are unemployed and have payment due?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name`
Write SQL query to solve given problem: What is the longest time for a student from the navy department to be absent from school?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: How many disabled students have never been absent from school?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: Please list the departments the students are absent from school for 9 months are in.. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: Which department has the most disabled students?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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
Write SQL query to solve given problem: Please list all the female students that have filed for bankruptcy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT name FROM filed_for_bankrupcy WHERE name NOT IN ( SELECT name FROM male )
Write SQL query to solve given problem: What is the percentage of male students in the navy department?. Keep the solution inside sql tag ```sql [SQL-Query] ```
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'
Write SQL query to solve given problem: What is the average time for a disabled student to be absent from school?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name`
Write SQL query to solve given problem: Name all students enlisted in the foreign legion.. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT name FROM enlist WHERE organ = 'foreign_legion'
Write SQL query to solve given problem: Does student348 have a due payment?. Keep the solution inside sql tag ```sql [SQL-Query] ```
student_loan
SELECT bool FROM no_payment_due WHERE name = 'student348'