problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Calculate the difference between the highest votes for episode and the lowest votes for episode.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT MAX(votes) - MIN(votes) FROM Vote; |
Write SQL query to solve given problem: List the name character awarded for the Outstanding Voice-Over Performance award 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 AND T1.award = 'Outstanding Voice-Over Performance'; |
Write SQL query to solve given problem: Among the person nominated for the Comedy Series Award in 2009, how many of them were born in California?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.year = 2009 AND T2.award = 'Comedy Series' AND T1.birth_region = 'California'; |
Write SQL query to solve given problem: What is the title of episode that won the Best International TV Series Award 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 SUBSTR(T1.year, 1, 4) = '2017' AND T1.award = 'Best International TV Series' AND T1.result = 'Winner'; |
Write SQL query to solve given problem: List the name of persons who were not included in the credit for the 'How the Test Was Won' episode.. 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.credited = 'false'; |
Write SQL query to solve given problem: What is the title of episode that has a keyword of 'riot' and 'cake'?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('riot', 'cake'); |
Write SQL query to solve given problem: Which episode has the most vote for 10 stars rating?. 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 = 10 ORDER BY T1.votes DESC LIMIT 1; |
Write SQL query to solve given problem: Name all the person who involved in the making of simpson 20s episode that aired between October to November.. 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 SUBSTR(T1.air_date, 6, 2) BETWEEN '10' AND '11'; |
Write SQL query to solve given problem: State the name of director for the 'Treehouse of Horror XIX' episode.. 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 = 'Treehouse of Horror XIX' AND T2.role = 'director'; |
Write SQL query to solve given problem: Based on the credits, state how many roles were played in the 5th episode of simpson 20.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(DISTINCT T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 5; |
Write SQL query to solve given problem: List all the keyword for 'Take My Life, Please' episode.. 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 = 'Take My Life, Please'; |
Write SQL query to solve given problem: Among the episode that get more than 950 votes, how many of the episodes were nominated for the 'Outstanding Voice-Over Performance Award in 2009'? Find the percentage of the episodes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT CAST(SUM(CASE WHEN T1.award = 'Outstanding Voice-Over Performance' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 950 AND T1.year = 2009; |
Write SQL query to solve given problem: What is the ratio between the 5 stars votes for 'No Loan Again, Naturally' episode and 'Coming to Homerica' episode?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT CAST(SUM(CASE WHEN T1.title = 'No Loan Again, Naturally' THEN T1.votes ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Coming to Homerica' THEN T1.votes ELSE 0 END) AS ratio FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 5; |
Write SQL query to solve given problem: How many times was Ian Maxtone-Graham nominated for an award in Writers Guild of America, USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(award_id) FROM Award WHERE person = 'Ian Maxtone-Graham' AND organization = 'Writers Guild of America, USA' AND result = 'Nominee'; |
Write SQL query to solve given problem: What is the name of the person that has the highest number of nominated award but didn't win?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT person FROM Award WHERE result = 'Nominee' GROUP BY person ORDER BY COUNT(person) DESC LIMIT 1; |
Write SQL query to solve given problem: What is the title of the episode that received the lowest rating?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT title FROM Episode ORDER BY rating LIMIT 1; |
Write SQL query to solve given problem: What year did the Simpsons receive its first ever award for Favorite Animated Comedy in People's Choice Award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT year FROM Award WHERE result = 'Winner' AND award = 'Favorite Animated Comedy' ORDER BY year DESC LIMIT 1; |
Write SQL query to solve given problem: How many episodes was Dell Hake not included in the credit list?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Credit WHERE person = 'Dell Hake' AND credited = 'false'; |
Write SQL query to solve given problem: How old was the awardee when he/she won the first-ever award for Outstanding Voice-Over Performance in Primetime Emmy Awards?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.year - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award = 'Outstanding Voice-Over Performance' AND T2.organization = 'Primetime Emmy Awards' AND T2.result = 'Winner'; |
Write SQL query to solve given problem: What character did Dan Castellaneta play that won him an award for Outstanding Voice-Over Performance in 2009 in the Primetime Emmy Awards?. 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.person = 'Dan Castellaneta' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.organization = 'Primetime Emmy Awards' AND T1.year = 2009; |
Write SQL query to solve given problem: Among the episodes aired on April of 2009, how many episodes won an award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(T1.episode_id) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T2.air_date LIKE '2009-04%'; |
Write SQL query to solve given problem: What is the birth place of the cast or crew member who won the Best Voice-Over Performance in Online Film & Television Association in 2009?. 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 = 'Best Voice-Over Performance' AND T2.organization = 'Online Film & Television Association' AND T2.year = 2009; |
Write SQL query to solve given problem: How many 10 star votes did the top 4 episodes with the highest rating received?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(T1.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars = 10 ORDER BY T1.rating DESC LIMIT 4; |
Write SQL query to solve given problem: In "No Loan Again, Naturally", how many stars received votes of no more than 50?. 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 T1.title = 'No Loan Again, Naturally' AND T2.votes < 50; |
Write SQL query to solve given problem: How many award winners are from the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'USA' AND T2.result = 'Winner'; |
Write SQL query to solve given problem: In Season 20 Episode 11, how many times was Doofus included in the credit list?. 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 T1.nickname = 'Doofus' AND T2.credited = 'true' AND T2.episode_id = 'S20-E11'; |
Write SQL query to solve given problem: What was the first award won by the cast or crew member of the show? Give the name of the person who won the said award.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.award, T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.result = 'Winner' ORDER BY T2.year LIMIT 1; |
Write SQL query to solve given problem: In "Sex, Pies and Idiot Scrapes", how many percentage of votes did the 9 star score has?. 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 T1.title = 'Sex, Pies and Idiot Scrapes' AND T2.stars = 9; |
Write SQL query to solve given problem: List the award name and persons who won the award in 2009.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT award, person FROM Award WHERE result = 'Winner' AND SUBSTR(year, 1, 4) = '2009'; |
Write SQL query to solve given problem: Among the casts who were born in Los Angeles, describe the name and birth date of who have 1.8 m and above in height.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name, birthdate FROM Person WHERE birth_place = 'Los Angeles' AND height_meters >= 1.8; |
Write SQL query to solve given problem: Provide the episode number, title and rating of which were aired in October, 2008.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT episode, title, rating FROM Episode WHERE SUBSTR(air_date, 1, 7) LIKE '2008-10%'; |
Write SQL query to solve given problem: Write down the award ID, award name and winner for character named "Homer simpson 20".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.award_id, T1.award, T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer Simpson' AND T1.result = 'Winner'; |
Write SQL query to solve given problem: List down the award name, result, credit category and credited status of the "Billy Kimball".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.award, T1.result, T2.category, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.person = 'Billy Kimball'; |
Write SQL query to solve given problem: Name the person, award, organization, result and credited status of the assistant director in S20-E13.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.person, T1.award, T1.organization, T1.result, T2.credited FROM Award AS T1 INNER JOIN Credit AS T2 ON T2.episode_id = T1.episode_id WHERE T2.episode_id = 'S20-E13' AND T2.role = 'assistant director'; |
Write SQL query to solve given problem: Describe the birth country, height and person name who were not included in credit list with category of casting.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.birth_country, T1.height_meters, T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T2.category = 'Cast' AND T2.credited = 'false'; |
Write SQL query to solve given problem: List the nominee, keywords and episode ID of the title "The Good, the Sad and the Drugly".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T3.person, T1.keyword, T1.episode_id FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id WHERE T2.title = 'The Good, the Sad and the Drugly' AND T3.result = 'Nominee'; |
Write SQL query to solve given problem: What is the voting numbers and percentage of the best rating scale of the episode which had keyword of "arab stereotype"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.votes, T2.percent FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.keyword = 'arab stereotype' AND T2.stars = 10; |
Write SQL query to solve given problem: For the episode who won the award held by Jupiter Award, describe award name, aired date and rating of that episode.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.award, T2.air_date, T2.rating FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Jupiter Award' AND T1.result = 'Winner'; |
Write SQL query to solve given problem: Mention the episode ID, title and any three keywords of the episode which get the most number of votes in star classification of worst.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T3.episode_id, T2.title, T1.keyword FROM Keyword AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 ORDER BY T3.votes DESC LIMIT 3; |
Write SQL query to solve given problem: Among the episodes with excellent rating which were aired in 2008, describe the title, episode's image, award name and person who were nominated.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.title, T2.episode_image, T1.award, T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.rating BETWEEN 7 AND 10 AND SUBSTR(T2.air_date, 1, 4) = '2008' AND T1.result = 'Nominee'; |
Write SQL query to solve given problem: Describe the award title, person and character name of the award ID 326.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.award, T1.person, T2.character FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.award_id = 326; |
Write SQL query to solve given problem: Describe name, birth country, role in episode and age in 2022 of the oldest crew member... Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.name, T1.birth_place, T2.role, 2022 - CAST(SUBSTR(T1.birthdate, 1, 4) AS int) AS age FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birthdate IS NOT NULL ORDER BY T1.birthdate LIMIT 1; |
Write SQL query to solve given problem: Provide the number of credits, category, role and birthplace of the crew member who was born in North Korea.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T2.credited, T2.category, T2.role, T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.birth_country = 'North Korea'; |
Write SQL query to solve given problem: Find the winning rate of award in 2010. Describe the winner name, award name, episode title and role of the winner in that episode.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T3.rate, T4.person, T4.award, T5.title, T4.role FROM ( SELECT CAST(SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.result IN ('Winner', 'Nominee') THEN 1 ELSE 0 END) AS rate , T1.person, T1.award, T2.title, T1.role FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2010' ) AS T3 INNER JOIN Award AS T4 INNER JOIN Episode AS T5 ON T4.episode_id = T5.episode_id WHERE T4.year = 2010 AND T4.result = 'Winner'; |
Write SQL query to solve given problem: Name the title of the episode that received the highest star score and the highest number of votes.. 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 ORDER BY T2.stars DESC, T2.votes DESC LIMIT 1; |
Write SQL query to solve given problem: What is the total number of awards won by The simpson 20s: Season 20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(award_id) FROM Award WHERE result = 'Winner'; |
Write SQL query to solve given problem: Name the title of the episode that was nominated for Emmy's Outstanding Animated Program 21 times.. 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.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T1.result = 'Nominee' GROUP BY T1.episode_id HAVING COUNT(T1.episode_id) = 21; |
Write SQL query to solve given problem: What is the average number of stars assigned to The simpson 20s: S20-E12? What is the said episode all about?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT AVG(T2.stars), T1.summary FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode_id = 'S20-E12'; |
Write SQL query to solve given problem: Name the performer who won Emmy Award for Outstanding Voice-Over Performance by playing Homer simpson 20.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.person FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T2.character = 'Homer simpson 20' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Voice-Over Performance' AND T1.result = 'Winner'; |
Write SQL query to solve given problem: What is the birth name of Al Jean and his role in creating The simpson 20s: Season 20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.birth_name, T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.name = T2.person WHERE T1.name = 'Al Jean'; |
Write SQL query to solve given problem: How many nominations have Billy Kimball received in 2010 for The simpson 20s: Season 20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(award_id) FROM Award WHERE person = 'Billy Kimball' AND SUBSTR(year, 1, 4) = '2010' AND result = 'Nominee'; |
Write SQL query to solve given problem: List all keywords associated with the episode 'Take My Life, Please'.. 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 = 'Take My Life, Please'; |
Write SQL query to solve given problem: Indicate the name and category of the most recent award received by the show.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT award, award_category FROM Award WHERE result = 'Winner' ORDER BY year DESC LIMIT 1; |
Write SQL query to solve given problem: What is The simpson 20s: Season 20 average awards winning rate?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT CAST(SUM(CASE WHEN result = 'Winner' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(award) AS rate FROM Award; |
Write SQL query to solve given problem: How many episodes were aired between October and November 2008?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(episode_id) FROM Episode WHERE air_date LIKE '2008-10%' OR air_date LIKE '2008-11%'; |
Write SQL query to solve given problem: Among episodes aired in 2009, which episode has received the worst response based on the rating.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT episode_id FROM Episode WHERE air_date LIKE '2009%' ORDER BY rating LIMIT 1; |
Write SQL query to solve given problem: List the categories for which Bonita Pietila was given credit and her role in creating the episodes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT category, role FROM Credit WHERE person = 'Bonita Pietila'; |
Write SQL query to solve given problem: Who from The simpson 20s: Season 20 cast and crew was born in October 29, 1957 in Chicago, Illinois?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name FROM Person WHERE birthdate = '1957-10-29' AND birth_place = 'Chicago' AND birth_region = 'Illinois'; |
Write SQL query to solve given problem: Who produced The simpson 20s: Season 20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT person FROM Credit WHERE role = 'producer'; |
Write SQL query to solve given problem: How old was composer of the show when he was nominated for Emmy's Outstanding Music Composition for a Series in 2009. Indicate his full name as well.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.year - T2.birthdate AS ageIn2009, T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person = T2.name WHERE T1.role = 'composer' AND T1.organization = 'Primetime Emmy Awards' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T1.result = 'Nominee' AND T1.year = 2009; |
Write SQL query to solve given problem: Which episode of The simpson 20s: Season 20 has received the most nominations? Indicate the title.. 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 GROUP BY T1.episode_id ORDER BY COUNT(*) DESC LIMIT 1; |
Write SQL query to solve given problem: Please indicate the birthplace of the crew which name is Dan Castellaneta.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT birth_place FROM Person WHERE name = 'Dan Castellaneta'; |
Write SQL query to solve given problem: How many crews were born in the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(name) FROM Person WHERE birth_country = 'USA'; |
Write SQL query to solve given problem: Please list the name of crew that were born before 1970.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) < '1970'; |
Write SQL query to solve given problem: Name of the crew that were born in California, USA between 1958 and 1969.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1958' AND birth_place = 'California' AND birth_country = 'USA'; |
Write SQL query to solve given problem: Which episode ids are rated 5 stars and have more than 100 votes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT episode_id FROM Vote WHERE stars = 5 AND votes > 100; |
Write SQL query to solve given problem: Please indicate the keywords of the title "Double, Double, Boy in Trouble".. 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 = 'Double, Double, Boy in Trouble'; |
Write SQL query to solve given problem: Among episodes from 10 to 20, which episode has more than 200 votes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.episode FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.episode BETWEEN 10 AND 20 AND T2.votes > 200; |
Write SQL query to solve given problem: Please indicate the keywords of the episode that won the Primetime Emmy Award category.. 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 = 'Primetime Emmy'; |
Write SQL query to solve given problem: Who is the recipient of the Primetime Emmy Award with the most votes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.person FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award_category = 'Primetime Emmy' ORDER BY T2.votes DESC LIMIT 1; |
Write SQL query to solve given problem: Which episode id did award Outstanding Animated Program (For Programming Less Than One Hour) with an episode star score of 10?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.stars = 10; |
Write SQL query to solve given problem: Please give the name of the director who achieved the Outstanding Animated Program (For Programming Less Than One Hour) award whose episode title is "No Loan Again, Naturally".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.role = 'director' AND T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)' AND T2.title = 'No Loan Again, Naturally'; |
Write SQL query to solve given problem: Please indicate which writer has an episode star score greater than 5 in 2009.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.person FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.role = 'writer' AND T2.votes > 5; |
Write SQL query to solve given problem: How many WGA Award (TV) award recipients were born in the USA from 2009 to 2010?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.name = T2.person WHERE T2.award_category = 'WGA Award (TV)' AND T1.birth_country = 'USA' AND T2.year BETWEEN 2009 AND 2010; |
Write SQL query to solve given problem: Which episode did the composer win for Outstanding Music Composition for a Series (Original Dramatic Score) with more than 200 votes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.episode_id FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.role = 'composer' AND T1.award = 'Outstanding Music Composition for a Series (Original Dramatic Score)' AND T2.votes > 200; |
Write SQL query to solve given problem: The person named Al Jean achieved the Primetime Emmy Award category in 2009, which episode did AI Jean achieve?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE SUBSTR(T1.year, 1, 4) = '2009' AND T1.person = 'Al Jean' AND T1.award_category = 'Primetime Emmy'; |
Write SQL query to solve given problem: How much more votes for episode 1 than for episode 5?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(CASE WHEN T1.episode = 1 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T1.episode = 5 THEN T2.votes ELSE 0 END) AS diff FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id; |
Write SQL query to solve given problem: What award did the character Homer simpson 20 achieve in 2009?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT DISTINCT T1.award FROM Award AS T1 INNER JOIN Character_Award AS T2 ON T1.award_id = T2.award_id WHERE T1.year = 2009 AND T2.character = 'Homer Simpson'; |
Write SQL query to solve given problem: How many episodes have won the award for Outstanding Animated Program (Programming Under One Hour) with less than 100 votes? Calculate the percentage of episodes with less than 100 votes out of total episodes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.votes < 100 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) 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 T1.award = 'Outstanding Animated Program (For Programming Less Than One Hour)'; |
Write SQL query to solve given problem: How many recipients of the Primetime Emmy Award category that were born in the USA? Find the percentage of Americans in the total number of the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(CASE WHEN T1.birth_country = 'USA' THEN 1 ELSE 0 END) AS num , 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.award_category = 'Primetime Emmy' AND T2.person = 'Dan Castellaneta'; |
Write SQL query to solve given problem: Please list two people who are the nominees for the "Outstanding Voice-Over Performance" award for season 20.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT person FROM Award WHERE result = 'Nominee' AND award = 'Outstanding Voice-Over Performance' AND episode_id LIKE 'S20%' LIMIT 2; |
Write SQL query to solve given problem: How many executive producers are the nominees for the award of "Outstanding Animated Program (For Programming Less Than One Hour)"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Award WHERE role = 'executive producer' AND result = 'Nominee' AND award = 'Outstanding Animated Program (For Programming Less Than One Hour)'; |
Write SQL query to solve given problem: In the crew, who was born in 1962 in California?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name FROM Person WHERE SUBSTR(birthdate, 1, 4) = '1962' AND birth_region = 'California'; |
Write SQL query to solve given problem: How many of the crew members who are taller than 1.70m were born in Canada?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(name) FROM Person WHERE height_meters > 1.70 AND birth_country = 'Canada'; |
Write SQL query to solve given problem: How many people were considered as prospective recipients of the "Animation" award?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT COUNT(*) FROM Award WHERE award = 'Animation' AND result = 'Nominee'; |
Write SQL query to solve given problem: Please list any three episodes that have an excellent rating.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT title FROM Episode WHERE rating BETWEEN 7 AND 10 LIMIT 3; |
Write SQL query to solve given problem: What are the top five most popular episodes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT episode_id FROM Episode ORDER BY votes DESC LIMIT 5; |
Write SQL query to solve given problem: Please list the three episodes with the highest number of votes for the worst star rating.. 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 = ( SELECT MIN(stars) FROM Vote ) ORDER BY T2.votes DESC LIMIT 3; |
Write SQL query to solve given problem: What was the character that Dan Castellaneta did the voice over for and was awarded?. 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 LIKE '%Voice-Over%' AND T1.person = 'Dan Castellaneta'; |
Write SQL query to solve given problem: Please list all of the episodes that aired in 2008 that have the highest number of votes for the maximum star rating.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT 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' ORDER BY T2.votes DESC LIMIT 1; |
Write SQL query to solve given problem: What are the keywords of the episode "Take My Life, Please"?. 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 = 'Take My Life, Please'; |
Write SQL query to solve given problem: Please provide any two episodes' names that have the same keyword of "1930s to 2020s".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = '1930s to 2020s' LIMIT 2; |
Write SQL query to solve given problem: In 2010, which episode did Joel H. Cohen win an award for?. 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 SUBSTR(T1.year, 1, 4) = '2010' AND T1.person = 'Joel H. Cohen'; |
Write SQL query to solve given problem: How many votes of 5-star did the episode "Lisa the Drama Queen" receive?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'Lisa the Drama Queen' AND T2.stars = 5; |
Write SQL query to solve given problem: What is the number of votes for 10-star for the episode that has the keyword "reference to the fantastic four"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT T2.votes FROM Keyword AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 AND T1.keyword = 'reference to the fantastic four'; |
Write SQL query to solve given problem: What is the difference between the number of votes for 1-star vs. 10-star for the episode "The Burns and the Bees"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT SUM(CASE WHEN T2.stars = 10 THEN T2.votes ELSE 0 END) - SUM(CASE WHEN T2.stars = 1 THEN T2.votes ELSE 0 END) AS Difference FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.title = 'The Burns and the Bees'; |
Write SQL query to solve given problem: What are the keywords of the least popular episode?. 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 ORDER BY T1.votes LIMIT 1; |
Write SQL query to solve given problem: What are the episodes that have the average rating with more than 20 of 2-star votes?. 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 = 2 AND T2.votes > 20 AND T1.rating > 5.0 AND T1.rating <= 7.0; |
Write SQL query to solve given problem: Which episode has the largest number of votes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT episode FROM Episode WHERE votes = ( SELECT MAX(votes) FROM Episode ); |
Write SQL query to solve given problem: Who is the oldest among all the casts and crews?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | simpson_episodes | SELECT name FROM Person ORDER BY birthdate ASC LIMIT 1; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.