db_id stringclasses 68 values | question stringlengths 24 325 | evidence stringlengths 0 580 | SQL stringlengths 23 728 |
|---|---|---|---|
law_episode | How many keywords are there in the episode Disciple? | episode Disciple refers to title = 'Disciple' | SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple' |
law_episode | Which episode got the most 1 star votes? Give its title. | the most refers to max(votes); 1 star refers to stars = '1' | SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 1 ORDER BY T1.votes DESC LIMIT 1 |
law_episode | How many nominations did Law and Order season 9, episode 20 get? | Law and Order refers to series = 'Law and Order' | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 20 |
law_episode | For season 9, episode 17 of the show Law and Order, how many roles have been included in the credit? | Law and Order refers to series = 'Law and Order'; included in the credit refers to credited = 'true' | SELECT COUNT(T2.role) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.series = 'Law and Order' AND T1.season = 9 AND T1.episode = 17 AND T2.credited = 'true' |
law_episode | Describe what happened in the episode of award no.296. | description of what happened refers to summary; award no.296 refers to award_id = '296' | SELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296 |
law_episode | Which role did Joseph Blair play in the show? | SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair' | |
law_episode | How many awards has Rene Balcer been nominated for? | SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer' | |
law_episode | For the episode with the most votes, give its air date. | the most votes refers to max(votes) | SELECT T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id GROUP BY T2.episode_id ORDER BY SUM(T1.votes) DESC LIMIT 1 |
law_episode | Who was nominated for award no.313? Give the full name. | award no.313 refers to award_id = '313'; full name refers to name | SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313 |
law_episode | How many episodes did J.K. Simmons' role appear on the show? | SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'J.K. Simmons' | |
law_episode | Display the number of 9-star votes the episode Sideshow received. | 9-star vote refers to stars = '9'; episode Sideshow refers to title = 'Sideshow' | SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 9 AND T1.title = 'Sideshow' |
law_episode | How many times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode? | "Refuge: Part 1" episode refers to title = 'Refuge: Part 1'; "Shield" episode refers to title = 'Shield'; times = divide(count(keyword where title = 'Refuge: Part 1'), count(keyword where title = 'Shield')) | SELECT CAST(SUM(CASE WHEN T1.title = 'Refuge: Part 1' THEN 1 ELSE 0 END) AS REAL) / SUM(CASE WHEN T1.title = 'Shield' THEN 1 ELSE 0 END) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id |
law_episode | Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode. | appeared in the credit refers to credited = 'TRUE'; from the 185th to the 193rd episode refers to number_in_series between 185 and 193; cast refers to category = 'Cast'; average number = divide(count(episode_id), 9) | SELECT CAST(COUNT(T1.episode_id) AS REAL) / (193 - 185 + 1) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T1.credited = 'true' AND T2.number_in_series BETWEEN 185 AND 193 |
law_episode | What are the names of the person that were not credited at the end of episode tt0629391? | not credited refers to credited = ''; episode tt0629391 refers to episode_id = 'tt0629391' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.credited = 'false' AND T1.episode_id = 'tt0629391' |
law_episode | How many people have won at least 3 awards? | won refers to result = 'Winner'; at least 3 awards refers to count(result) > 3 | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.result = 'Winner' GROUP BY T1.person_id HAVING COUNT(T2.award_id) >= 3 |
law_episode | Who is the script supervisor of the series in episode tt0629204? | who refers to name; script supervisor refers to role = 'script supervisor'; episode tt0629204 refers to episode_id = 'tt0629204' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629204' AND T1.role = 'script supervisor' |
law_episode | How many awards has Julia Roberts been nominated for? | been nominated refers to result = 'Nominee' | SELECT COUNT(T2.award_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Julia Roberts' AND T2.result = 'Nominee' |
law_episode | Who is the tallest camera operator? | who refers to name; the tallest refers to max(height_meters); camera operator refers to role = 'camera operator' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'camera operator' ORDER BY T2.height_meters DESC LIMIT 1 |
law_episode | How many people, who were born in Canada, won an award in 1999? | born in Canada refers to birth_country = 'Canada'; in 1999 refers to year = 1999 | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 1999 AND T1.birth_country = 'Canada' |
law_episode | How many people gave the most enjoyed episode a 10-star rating? | the most enjoyed refers max(rating); 10-star refers to stars = 10 | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 |
law_episode | What are the keywords of the "Shield" episode? | "Shield" episode refers to title = 'Shield' | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield' |
law_episode | What is the percentage of people who gave the "True North" episode a 1-star rating? | the "True North" episode refers to title = 'True North'; 1-star refers to stars = 1; percentage = divide(count(episode_id where stars = 1), count(episode_id)) * 100% where title = 'True North' | SELECT CAST(SUM(CASE WHEN T2.stars = 1 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' AND T1.episode_id = 'tt0629477' |
law_episode | What is the title of the episode with the highest number of keywords? | the highest number of keywords refers to max(count(keyword)) | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.episode_id ORDER BY COUNT(T2.keyword) DESC LIMIT 1 |
law_episode | How many times did the episode titled "Agony" win an award? | titled "Agony" refers to title = 'Agony'; win an award refers to result = 'Winner' | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' |
law_episode | How many episodes are there in the 9th season of Law and Order? Calculate the average number of casts per season of the said series. | the 9th season refers to season = 9; Law and Order refers to series = 'Law and Order'; cast refers to category = 'Cast'; average number of casts per season = divide(count(person_id), count(episode_id)) | SELECT SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS num , CAST(SUM(CASE WHEN T2.season = 9 THEN 1 ELSE 0 END) AS REAL) / COUNT(T1.episode_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Cast' AND T2.series = 'Law and Order' |
law_episode | What are the keywords of the episode which received the 2nd-highest number of votes? | the 2nd-highest number of votes refers to second max(votes) | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.votes NOT IN ( SELECT MAX(T1.votes) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id ) ORDER BY T1.votes DESC LIMIT 1 |
law_episode | How many awards did the "Agony" win? | the "Agony" refers to title = 'Agony'; win refers to result = 'Winner' | SELECT COUNT(T2.award) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Agony' AND T2.result = 'Winner' |
law_episode | Who is the narrator of the "Flight" episode? | who refers to name; narrator refers to role = 'Narrator'; the "Flight" episode refers to title = 'Flight' | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.title = 'Flight' AND T2.role = 'Narrator' |
law_episode | In which organization did Constantine Makris win the most awards? | win refers to result = 'Winner'; the most awards refers to max(count(award_id)) | SELECT T2.organization FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Constantine Makris' AND T2.result = 'Winner' GROUP BY T2.organization ORDER BY COUNT(T2.award_id) DESC LIMIT 1 |
law_episode | Who is the stunt coordinator in episode 3? | who refers to name; stunt coordinator refers to role = 'stunt coordinator' | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 3 AND T2.role = 'stunt coordinator' |
law_episode | How many people were not credited at the end of the "Admissions" episode? | not credited refers to credited = ''; the "Admissions" episode refers to title = 'Admissions' | SELECT COUNT(T2.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Admissions' AND T2.credited = 'false' |
law_episode | What is the title of the episode that has the highest number of crews in the Art Department? | the highest number of crews refers to max(count(person_id)); in the Art Department refers to category = 'Art Department' | SELECT T2.title FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.category = 'Art Department' GROUP BY T2.episode_id ORDER BY COUNT(T1.category) DESC LIMIT 1 |
law_episode | How many roles did Julia Roberts play in the series? | SELECT COUNT(T1.role) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Julia Roberts' | |
law_episode | What are the titles of the top 3 episodes that received no less than 30 votes in its 10-star rating? | no less than 30 votes refers to votes > = 30; 10-star rating refers to stars = 10 | SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.votes >= 30 AND T1.stars = 10 ORDER BY T1.votes DESC LIMIT 3 |
law_episode | Who is the youngest person to ever play a "clerk" role in the series? | who refers to name; the youngest person refers to max(birthdate); a "clerk" role refers to role = 'Clerk' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'Clerk' AND T2.birthdate IS NOT NULL ORDER BY T2.birthdate LIMIT 1 |
law_episode | How many people did not enjoy the finale episode? | did not enjoy refers to stars = 1; the finale episode refers to episode = 24 | SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 24 AND T2.stars = 1 |
law_episode | List the names of all the cast members in the series. | cast member refers to category = 'Cast' | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast' |
law_episode | Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared. | who refers to name; appear the most refers to max(count(person_id)); percentage = divide(count(person_id where max(count(person_id))), count(person_id)) * 100% | SELECT T2.person_id, CAST(COUNT(T2.person_id) AS REAL) * 100 / ( SELECT COUNT(T2.person_id) AS num FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id ) AS per FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id GROUP BY T2.person_id ORDER BY COUNT(T2.person_id) DESC LIMIT 1 |
law_episode | Which episodes of the Law & Order have been nominated for the Primetime Emmy Awards? | episode refers to award; the Primetime Emmy Awards refers to award_category like 'Primetime Emmy' | SELECT DISTINCT episode_id FROM Award WHERE award_category = 'Primetime Emmy' |
law_episode | How many episodes have not won any Law & Order series awards? | have not won any award refers to Result = 'Nominee' | SELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee' |
law_episode | What roles have not been credited at the end of the episodes? | have not been credited refers to credited = '' | SELECT DISTINCT role FROM Credit WHERE credited = 'false' |
law_episode | What is the title of the 3 worst rated episodes? | worst rated refers to min(rating) | SELECT title FROM Episode ORDER BY rating LIMIT 3 |
law_episode | What is the full place of birth of Rene Chenevert Balcer? | full place of birth refers to birth_place, birth_region; Rene Chenevert Balcer refers to birth_name = 'Rene Chenevert Balcer' | SELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer' |
law_episode | What is the name of the actors born in the USA? | born in the USA refers to birth_country = 'USA' | SELECT name FROM Person WHERE birth_country = 'USA' |
law_episode | What is the title of the episodes that were least enjoyed? | least enjoyed refers to stars = 1 | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 1 |
law_episode | What are the names of the two people who won an award for their role as directors? | won an award refers to result = 'Winner'; role as director refers to role = 'director' | SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Winner' AND T2.role = 'director' |
law_episode | How many votes did the episode titled Juvenile get? | the episode titled Juvenile refers to title = 'Juvenile' | SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Juvenile' |
law_episode | In which episodes was Anthony Azzara not credited? | which episode refers to title; not credited refers to credited = '' | SELECT T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.credited = 'false' AND T3.name = 'Anthony Azzara' |
law_episode | In what year did the episodes titled DWB get an award? | titled DWB refers to title = 'DWB'; get an award refers to result = 'Winner' | SELECT DISTINCT T1.year FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'DWB' AND T1.result = 'Winner' |
law_episode | In which region were the assistant location managers born? | region refers to birth_region; assistant location manager refers to role = 'assistant location manager' | SELECT T2.birth_region FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.role = 'president of NBC West Coast' |
law_episode | How many stars did the episodes in which Donna Villella worked? | SELECT COUNT(T3.person_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Donna Villella' | |
law_episode | What role was Julia Roberts nominated for? | nominated refers to result = 'Nominee' | SELECT T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.Result = 'Nominee' AND T1.name = 'Julia Roberts' |
law_episode | What role does the tallest person play? | the tallest refers to max(height_meters) | SELECT T2.role FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Award AS T3 ON T2.episode_id = T3.episode_id ORDER BY T1.height_meters DESC LIMIT 1 |
law_episode | What is the title of the episode with the most nominations? | the most nominations refers to max(count(episode_id where result = 'Nominee')) | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' GROUP BY T2.episode_id ORDER BY COUNT(T1.result) DESC LIMIT 1 |
law_episode | What was the rating of the episodes that Jace Alexander worked on? | SELECT T1.rating FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T3.name = 'Jace Alexander' | |
law_episode | What are the names of all the people who worked on episode 19 of season 9? | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 19 AND T1.season = 9 | |
law_episode | What is the average star rating of the episodes Jim Bracchitta has worked on? | average star rating = divide(sum(stars), count(episode_id)) where name = 'Jim Bracchitta' | SELECT CAST(SUM(T3.stars) AS REAL) / COUNT(T2.episode_id) FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id INNER JOIN Vote AS T3 ON T2.episode_id = T3.episode_id WHERE T3.stars = 1 AND T1.name = 'Jim Bracchitta' |
law_episode | What percentage of people have worked on the True North episode as additional crew? | the True North episode refers to title = 'True North'; additional crew refers to role = 'Additional Crew'; percentage = divide(count(episode_id where role = 'Additional Crew'), count(episode_id)) * 100% where title = 'True North' | SELECT CAST(SUM(CASE WHEN T2.role = 'Additional Crew' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'True North' |
law_episode | Write down the title, summary, and air date of the episode that garnered 72 10-star votes. | 72 10-star votes refers to stars = 10 and votes = 72 | SELECT T2.title, T2.summary, T2.air_date FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10 AND T1.votes = 72 |
law_episode | How many 6-star votes did episode 12 get? Please include the air date and rating. | 6-star vote refers to stars = 6 | SELECT T2.air_date, T2.rating FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 6 AND T2.episode = 12 |
law_episode | Who is the winner of the Best Television Episode award for the Edgar category in 2000? Include his or her name and role. | the Best Television Episode award refers to award = 'Best Television Episode'; the Edgar category refers to award_category = 'Edgar'; in 2000 refers to year = 2000 | SELECT T1.name, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.year = 2000 AND T2.award_category = 'Edgar' AND T2.award = 'Best Television Episode' |
law_episode | Write down the organization, year, award, and award category in which Rene Balcer is the winner. | Rene Balcer refers to name = 'Rene Balcer'; the winner refers to result = 'Winner' | SELECT T2.organization, T2.year, T2.award, T2.award_category FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.name = 'Rene Balcer' AND T2.result = 'Winner' |
law_episode | Who was the Law and Order series writer who also won the Television Silver Gavel Award at the American Bar Association Silver Gavel Awards for Media and the Arts for two consecutive years? | who refers to name; writer refers to role = 'writer'; won refers to result = 'Winner'; the Television refers to award = 'Television'; Silver Gavel Award refers to award_category = 'Silver Gavel Award'; the American Bar Association Silver Gavel Awards for Media and the Arts refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' | SELECT t3.name FROM ( SELECT DISTINCT T2.year AS years, T1.name, row_number() OVER (PARTITION BY T1.name ORDER BY T2.year) AS rm FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award = 'Television' AND T2.award_category = 'Silver Gavel Award' AND T2.series = 'Law and Order' AND T2.result = 'Winner' AND T2.organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' ) AS T3 GROUP BY t3.name HAVING COUNT(t3.years - t3.rm) >= 2 |
law_episode | How many times was episode 20 of the Law and Order series nominated for the Primetime Emmy Awards in 1999? | nominated refers to result = 'nominee'; the Law and Order series refers to series = 'Law and Order'; the Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards'; in 1999 refers to year = 1999 | SELECT COUNT(T2.award_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.year = 1999 AND T2.result = 'Nominee' AND T1.episode = 20 AND T2.organization = 'Primetime Emmy Awards' AND T1.series = 'Law and Order' |
law_episode | On what episode did Julia Roberts win the "Outstanding Guest Actress in a Drama Series" award during the 1999 Primetime Emmy Awards? Tell me her role. | win refers to result = 'Winner'; the "Outstanding Guest Actress in a Drama Series" award refers to award = 'Outstanding Guest Actress in a Drama Series'; the 1999 refers to year = 1999; Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards' | SELECT T3.episode_id, T2.role FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id INNER JOIN Episode AS T3 ON T2.episode_id = T3.episode_id WHERE T2.year = 1999 AND T2.award = 'Outstanding Guest Actress in a Drama Series' AND T2.organization = 'Primetime Emmy Awards' AND T1.name = 'Julia Roberts' AND T2.result = 'Nominee' |
law_episode | List the titles and air dates of episodes that were produced by Billy Fox. | produced refers to role = 'producer' | SELECT T1.title, T1.air_date FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T2.category = 'Produced by' AND T2.role = 'producer' AND T3.name = 'Billy Fox' |
law_episode | Among the American casts, how many were uncredited on episode ID tt0629228? | American refers to birth_country = 'USA'; cast refers to category = 'Cast'; uncredited refers to credited = '' | SELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.episode_id = 'tt0629228' AND T1.category = 'Cast' AND T1.credited = 'false' AND T2.birth_country = 'USA' |
law_episode | What was the role of Jason Kuschner in episode 9? | SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 9 AND T2.name = 'Jason Kuschner' | |
law_episode | Who played the role of the "president of NBC West Coast" in the first episode? | who refers to name; the role of the "president of NBC West Coast" refers to role = 'president of NBC West Coast'; the first episode refers to episode = 1 | SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.episode = 1 AND T1.role = 'president of NBC West Coast' |
law_episode | List down the titles of the top 3 episodes, from highest to lowest, in terms of their weighted stars. | weighted stars = divide(sum(stars, percent), 100) | SELECT T2.title FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars BETWEEN 1 AND 10 GROUP BY T2.title ORDER BY CAST(SUM(T1.stars * T1.percent) AS REAL) / 100 DESC LIMIT 3 |
law_episode | How many people from Canada are nominated for an award? | from Canada refers to birth_country = Canada; nominated refers to award is NOT NULL | SELECT COUNT(T1.person_id) FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T1.birth_country = 'Canada' |
law_episode | How many episodes are credited to Jerry Orbach? | SELECT COUNT(T2.person_id) FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Jerry Orbach' | |
law_episode | List out all the credit names for episode 9. | credit name refers to name | SELECT T3.name FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T3.person_id = T2.person_id WHERE T1.episode = 9 |
law_episode | List out all award titles nominated for episode 20. | award title refers to title; nominated refers to result = 'Winner' or result = 'Nominee' | SELECT T2.award FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T1.episode = 20 AND T2.result IN ('Winner', 'Nominee') |
law_episode | List out director names that received an award along with the episode number. | director refers to role = 'director'; received an award refers to result = 'Winner'; episode number refers to episode | SELECT T3.name, T1.episode_id FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Person AS T3 ON T2.person_id = T3.person_id WHERE T2.role = 'director' AND T2.result = 'Winner' |
law_episode | Which episodes are nominated for an awards but not win? | nominated for an award but not win refers to result = 'Nominee' | SELECT T1.episode FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Nominee' |
law_episode | What is the average rating for each episode in season 9? | average rating = divide(sum(rating), count(episode_id)) | SELECT SUM(rating) / COUNT(episode_id) FROM Episode WHERE season = 9 |
law_episode | What is the difference of 10 stars votes between the first episode and the last episode? | the first episode refers to episode = 1; the last episode refers to episode = 24; 10 stars vote refers to stars = 10; the difference = subtract(votes where episode = 1, votes where episode = 24) where stars = 10 | SELECT SUM(CASE WHEN T2.episode = 24 THEN T1.votes ELSE 0 END) - SUM(CASE WHEN T2.episode = 1 THEN T1.votes ELSE 0 END) FROM Vote AS T1 INNER JOIN Episode AS T2 ON T2.episode_id = T1.episode_id WHERE T1.stars = 10 |
law_episode | What is the episode rating with the most award won? | the most award won refers to max(episode_id where result = 'Winner') | SELECT T1.rating FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.result = 'Winner' GROUP BY T1.episode_id ORDER BY COUNT(T2.award_id) DESC LIMIT 1 |
law_episode | How many credits have been displayed from episode 1 until 10? | credit displayed refers to credited = 'true'; from episode 1 until 10 refers to episode > = 1 AND episode < = 10 | SELECT COUNT(T1.person_id) FROM Credit AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.credited = 'true' AND T2.episode BETWEEN 1 AND 10 |
law_episode | What is the episode that has mafia keyword? | mafia keyword refers to Keyword = 'mafia' | SELECT T1.episode FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.Keyword = 'mafia' |
law_episode | What is the average star with highest percentage for episodes that have received award? | received award refers to result = 'Winner'; the highest percentage refers to max(percent); average star = divide(sum(stars), count(episode_id)) | SELECT T2.person_id FROM Vote AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id ORDER BY T1.percent DESC LIMIT 1 |
law_episode | What is the average ranking episodes that are nominated for an award? | average ranking = divide(sum(rating), sum(episode_id)) | SELECT SUM(T1.rating) / COUNT(T1.episode) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id |
law_episode | How many winners have been awarded a Television award by the "American Bar Association Silver Gavel Awards for Media and the Arts"? | winner refers to result = 'Winner'; Television award refers to award = 'Television'; the "American Bar Association Silver Gavel Awards for Media and the Arts" refers to organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' | SELECT COUNT(award_id) FROM Award WHERE result = 'Winner' AND award = 'Television' AND organization = 'American Bar Association Silver Gavel Awards for Media and the Arts' |
law_episode | Which continent was Michael Preston born on? | continent refers to birth_country | SELECT birth_country FROM Person WHERE name = 'Michael Preston' |
law_episode | Who was the nominee playing the role of Katrina Ludlow in the Law & Order series? | nominee refers to result = 'Nominee'; the role of Katrina Ludlow refers to role = 'Katrina Ludlow' | SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Nominee' AND T1.role = 'Katrina Ludlow' AND T1.series = 'Law and Order' |
law_episode | Who played the role of a teleplay in the episode that won "Best Television Episode"? | the role of a teleplay refers to role = 'teleplay'; won refers to result = 'Winner'; "Best Television Episode" refers to award = 'Best Television Episode' | SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T1.award = 'Best Television Episode' |
law_episode | What is the date of birth of the actor who played the role of a "writer"? | date of birth refers to birthdate | SELECT T2.birthdate FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.role = 'writer' |
law_episode | Which episode was nominated for the award for "Outstanding Costume Design for a Series"? | episode refers to title; "Outstanding Costume Design for a Series" refers to award = 'Outstanding Costume Design for a Series' | SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Outstanding Costume Design for a Series' |
law_episode | Which episode has the highest total number of viewer votes? | episode refers to title; the highest total number of viewer votes refers to max(sum(votes)) | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id GROUP BY T1.title ORDER BY SUM(T1.votes) DESC LIMIT 1 |
law_episode | Who was the actor who was portraying "Alex Brown" and has been credited? | who refers to name; portraying "Alex Brown" refers to role = 'Alex Brown'; has been credited refers to credited = 'true' | SELECT T1.name FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T2.role = 'Alex Brown' AND T2.credited = 'true' |
law_episode | Where is the place of birth of the actor with the number nm0007064 who has not been credited for playing the role of a "Narrator"? | place of birth refers to birth_place; actor with the number nm0007064 refers to person_id = 'nm007064'; has not been credited refers to credited = ''; the role of a "Narrator" refers to role = 'narrator' | SELECT DISTINCT T1.birth_place FROM Person AS T1 INNER JOIN Credit AS T2 ON T1.person_id = T2.person_id WHERE T1.person_id = 'nm0007064' AND T2.role = 'Narrator' AND T2.credited = 'false' |
law_episode | What are the keywords of the episode "Shield"? | the episode "Shield" refers to title = 'Shield' | SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield' |
law_episode | Who are the actors with a height of over 1.80m in an episode that won an award? | who refers to name; a height of over 1.80m refers to height_meters > 1.80; won an award refers to result = 'Winner' | SELECT T2.name FROM Award AS T1 INNER JOIN Person AS T2 ON T1.person_id = T2.person_id WHERE T1.result = 'Winner' AND T2.height_meters > 1.80 |
law_episode | Which episode has the two keywords "nun" and "priest"? | episode refers to title; the two keywords "nun" and "priest" refers to keyword = 'nun' or keyword = 'priest'; | SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword IN ('nun', 'priest') |
law_episode | Which episode number has the second highest positive viewer comments and has been awarded "Best Television Episode"? | episode number refers to episode_id; awarded "Best Television Episode" refers to award = 'Best Television Episode' and result = 'Winner'; the second highest positive viewer comments refers to rating = 8.5 | SELECT T2.episode_id FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.award = 'Best Television Episode' AND T1.result = 'Winner' ORDER BY T2.rating DESC LIMIT 2 |
law_episode | Please list any three episodes that were most enjoyed by the viewers. | episode refers to title; most enjoyed by the viewers refers to stars = 10 | SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 LIMIT 3 |
synthea | According to the observation on 2008/3/11, what was the height of Elly Koss? | 2008/3/11 refers to date = '2008-03-11'; height refers to DESCRIPTION = 'Body Height' from observations; | SELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.date = '2008-03-11' AND T2.description = 'Body Height' |
synthea | During all the observations of Elly Koss, what was the highest Systolic Blood Pressure observed? | the highest Systolic Blood Pressure refers to MAX(DESCRIPTION = 'Systolic Blood Pressure') from observations; | SELECT T2.value, T2.units FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure' ORDER BY T2.VALUE DESC LIMIT 1 |
synthea | For how many times had Elly Koss have her Systolic Blood Pressure observed? | Systolic Blood Pressure refers to DESCRIPTION = 'Systolic Blood Pressure'; | SELECT COUNT(T2.description) FROM patients AS T1 INNER JOIN observations AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND T1.last = 'Koss' AND T2.description = 'Systolic Blood Pressure' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.