Chinastark/bird_dataset huggingface dataset:
Database: talkingdata
Question: What is the percentage of users who are in the same behavior category as "Academic Information"?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(category = 'Academic Information'), COUNT(app_id)), 1.0); behavior category refers to category; category = 'Academic Information';
SQL: SELECT SUM(IIF(T1.category = 'Academic Information', 1.0, 0)) / COUNT(T2.app_id) AS per FROM label_categories AS T1 INNER JOIN app_labels AS T2 ON T1.label_id = T2.label_id
Database: talkingdata
Question: What is the percentage of device users in the F27-28 age group who experienced an event on the 3rd of May 2016?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(`group` = 'F27-28'), COUNT(device_id)), 1.0); on the 3rd of May 2016 refers to timestamp = '2016-05-03%';
SQL: SELECT SUM(IIF(T1.`group` = 'F27-28', 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE SUBSTR(T2.timestamp, 1, 10) = '2016-05-03'
Database: talkingdata
Question: How many OPPO devices are there?
Evidence: OPPO devices refers to phone_brand = 'OPPO';
SQL: SELECT COUNT(device_id) FROM phone_brand_device_model2 WHERE phone_brand = 'OPPO'
Database: talkingdata
Question: What is the most common age group among all device users?
Evidence: most common age group refers to MAX(COUNT(`group`));
SQL: SELECT T.num FROM ( SELECT `group`, COUNT(`group`) AS num FROM gender_age GROUP BY `group` ) T
Database: talkingdata
Question: How many events does the device "4069764298338760000" have?
SQL: SELECT COUNT(event_id) FROM events WHERE device_id = 4069764298338760000
Database: talkingdata
Question: How many of the apps belong in the "Equity Fund" category?
SQL: SELECT COUNT(T1.app_id) FROM app_labels AS T1 INNER JOIN label_categories AS T2 ON T1.label_id = T2.label_id WHERE T2.category = 'Equity Fund'
Database: talkingdata
Question: List all females aged 24 to 26 devices' locations.
Evidence: females refers to gender = 'F'; aged 24 to 26 refers to `group` = 'F24-26';
SQL: SELECT T2.longitude, T2.latitude FROM gender_age AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T1.`group` = 'F24-26' AND T1.gender = 'F'
Database: talkingdata
Question: How many male users have a Galaxy Note 3?
Evidence: male refers to gender = 'M'; Galaxy Note 3 refers to device_model = 'Galaxy Note 3';
SQL: SELECT COUNT(T1.device_id) FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.device_model = 'Galaxy Note 3' AND T1.gender = 'M'
Database: talkingdata
Question: List all the devices' brands and models of events on 5/7/2016 at 6:03:22 AM.
Evidence: devices' brands refers to phone_brand; models refers to device_model; on 5/7/2016 at 6:03:22 AM refers to timestamp = '2016-05-07 06:03:22';
SQL: SELECT T1.phone_brand, T1.device_model FROM phone_brand_device_model2 AS T1 INNER JOIN events_relevant AS T2 ON T1.device_id = T2.device_id WHERE T2.timestamp = '2016-05-07 06:03:22'
Database: talkingdata
Question: Which brand is most common among people in their twenties?
Evidence: brand refers to phone_brand; brand that is most common refers to MAX(COUNT(phone_brand)); twenties refers to age BETWEEN 20 AND 30;
SQL: SELECT T.phone_brand FROM ( SELECT T2.phone_brand, COUNT(T2.phone_brand) AS num FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T1.age BETWEEN 20 AND 30 GROUP BY T2.phone_brand ) AS T ORDER BY T.num DESC LIMIT 1
Database: talkingdata
Question: What percentage of vivo devices belong to users with no information?
Evidence: percentage = MULTIPLY(DIVIDE(SUM(gender = NULL and age = NULL and `group` = NULL), COUNT(device_id)), 1.0); vivo devices refers to phone_brand = 'vivo'; no information refers to gender = NULL AND age = NULL AND `group` = NULL;
SQL: SELECT SUM(IIF(T1.gender IS NULL AND T1.age IS NULL AND T1.`group` IS NULL, 1, 0)) / COUNT(T1.device_id) AS per FROM gender_age AS T1 INNER JOIN phone_brand_device_model2 AS T2 ON T1.device_id = T2.device_id WHERE T2.phone_brand = 'vivo'
Database: law_episode
Question: Please list all the keywords of the episode "Refuge: Part 1".
Evidence: episode "Refuge: Part 1" refers to title = 'Refuge: Part 1'
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Refuge: Part 1'
Database: law_episode
Question: How many keywords are there for season 9, episode 23 of law_and_order?
SQL: SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.season = 9 AND T1.episode = 23
Database: law_episode
Question: What is the title of the episode with the keyword "laundering money"?
Evidence: keyword "laundering money" refers to keyword = 'laundering money'
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T2.keyword = 'laundering money'
Database: law_episode
Question: Please list all the keywords for the episodes with a rating of over 8.
Evidence: a rating of over 8 refers to rating > 8
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.rating > 8
Database: law_episode
Question: How many 10-star votes were given to the episode titled "Cherished"?
Evidence: 10-star vote refers to stars = 10; titled "Cherished" refers to title = 'Cherished'
SQL: SELECT T2.votes FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.stars = 10
Database: law_episode
Question: How many votes did the episode titled "Cherished" get in total?
Evidence: titled "Cherished" refers to title = 'Cherished'
SQL: SELECT SUM(T2.votes) FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished'
Database: law_episode
Question: What is the title of the episode that got the most 10-star votes?
Evidence: the most refers to max(votes); 10-star refers to stars = 10
SQL: SELECT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id WHERE T2.stars = 10 ORDER BY T2.votes DESC LIMIT 1
Database: law_episode
Question: Park Dietz was credited in which role in the episode titled "Cherished"?
Evidence: credited refers to credited = 'true'; titled "Cherished" refers to title = 'Cherished'
SQL: SELECT T2.role 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 = 'Cherished' AND T3.name = 'Park Dietz' AND T2.credited = 'true'
Database: law_episode
Question: How many people had filled a role in the episode titled "Cherished", but did not show up in the on-screen credits?
Evidence: titled "Cherished" refers to title = 'Cherished'; did not show up in the on-screen credits refers to credited = ''
SQL: SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Cherished' AND T2.credited = 'false'
Database: law_episode
Question: Who was credited as "technical advisor" in the episode titled "Cherished"?
Evidence: who refers to name; credited refers to credited = 'true'; as "technical advisor" refers to role = 'technical advisor'; titled "Cherished" refers to title = 'Cherished'
SQL: 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 = 'Cherished' AND T2.credited = 'true' AND T2.role = 'technical advisor'
Database: law_episode
Question: For how many times was Park Dietz credited?
Evidence: credited refers to credited = 'true'
SQL: 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 T2.credited = 'true' AND T3.name = 'Park Dietz'
Database: law_episode
Question: Please list the titles of all the episodes in which Park Dietz was credited.
Evidence: credited refers to credited = 'true'
SQL: 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 = 'true' AND T3.name = 'Park Dietz'
Database: law_episode
Question: Was Anthony Azzara's role in episode tt0629204 displayed in the credits at the end of the episode?
Evidence: episode tt0629204 refers to episode_id = 'tt0629204'; credited refers to credited = 'true'; not credited refers to credited = ''
SQL: SELECT T1.credited FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Anthony Azzara' AND T1.episode_id = 'tt0629204'
Database: law_episode
Question: How many keywords are there in the episode Disciple?
Evidence: episode Disciple refers to title = 'Disciple'
SQL: SELECT COUNT(T2.keyword) FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Disciple'
Database: law_episode
Question: Which episode got the most 1 star votes? Give its title.
Evidence: the most refers to max(votes); 1 star refers to stars = '1'
SQL: 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
Database: law_episode
Question: How many nominations did Law and Order season 9, episode 20 get?
Evidence: Law and Order refers to series = 'Law and Order'
SQL: 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
Database: law_episode
Question: For season 9, episode 17 of the show Law and Order, how many roles have been included in the credit?
Evidence: Law and Order refers to series = 'Law and Order'; included in the credit refers to credited = 'true'
SQL: 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'
Database: law_episode
Question: Describe what happened in the episode of award no.296.
Evidence: description of what happened refers to summary; award no.296 refers to award_id = '296'
SQL: SELECT T1.summary FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE T2.award_id = 296
Database: law_episode
Question: Which role did Joseph Blair play in the show?
SQL: SELECT T1.role FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T2.name = 'Joseph Blair'
Database: law_episode
Question: How many awards has Rene Balcer been nominated for?
SQL: 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'
Database: law_episode
Question: For the episode with the most votes, give its air date.
Evidence: the most votes refers to max(votes)
SQL: 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
Database: law_episode
Question: Who was nominated for award no.313? Give the full name.
Evidence: award no.313 refers to award_id = '313'; full name refers to name
SQL: SELECT T1.name FROM Person AS T1 INNER JOIN Award AS T2 ON T1.person_id = T2.person_id WHERE T2.award_id = 313
Database: law_episode
Question: How many episodes did J.K. Simmons' role appear on the show?
SQL: 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'
Database: law_episode
Question: Display the number of 9-star votes the episode Sideshow received.
Evidence: 9-star vote refers to stars = '9'; episode Sideshow refers to title = 'Sideshow'
SQL: 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'
Database: law_episode
Question: How many times is the number of keywords in "Refuge: Part 1" episode than "Shield" episode?
Evidence: "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'))
SQL: 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
Database: law_episode
Question: Calculate the average number of cast members that appeared in the credit from the 185th to the 193rd episode.
Evidence: 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)
SQL: 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
Database: law_episode
Question: What are the names of the person that were not credited at the end of episode tt0629391?
Evidence: not credited refers to credited = ''; episode tt0629391 refers to episode_id = 'tt0629391'
SQL: 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'
Database: law_episode
Question: How many people have won at least 3 awards?
Evidence: won refers to result = 'Winner'; at least 3 awards refers to count(result) > 3
SQL: 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
Database: law_episode
Question: Who is the script supervisor of the series in episode tt0629204?
Evidence: who refers to name; script supervisor refers to role = 'script supervisor'; episode tt0629204 refers to episode_id = 'tt0629204'
SQL: 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'
Database: law_episode
Question: How many awards has Julia Roberts been nominated for?
Evidence: been nominated refers to result = 'Nominee'
SQL: 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'
Database: law_episode
Question: Who is the tallest camera operator?
Evidence: who refers to name; the tallest refers to max(height_meters); camera operator refers to role = 'camera operator'
SQL: 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
Database: law_episode
Question: How many people, who were born in Canada, won an award in 1999?
Evidence: born in Canada refers to birth_country = 'Canada'; in 1999 refers to year = 1999
SQL: 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'
Database: law_episode
Question: How many people gave the most enjoyed episode a 10-star rating?
Evidence: the most enjoyed refers max(rating); 10-star refers to stars = 10
SQL: 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
Database: law_episode
Question: What are the keywords of the "Shield" episode?
Evidence: "Shield" episode refers to title = 'Shield'
SQL: SELECT T2.keyword FROM Episode AS T1 INNER JOIN Keyword AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'Shield'
Database: law_episode
Question: What is the percentage of people who gave the "True North" episode a 1-star rating?
Evidence: 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'
SQL: 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'
Database: law_episode
Question: What is the title of the episode with the highest number of keywords?
Evidence: the highest number of keywords refers to max(count(keyword))
SQL: 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
Database: law_episode
Question: Among the episodes that were aired in 1998, how many won an International Monitor Awards?
Evidence: aired in 1998 refers to air_date like '1998%'; won refers to result = 'Winner'; International Monitor Awards refers to organization = 'International Monitor Awards'
SQL: SELECT COUNT(T1.episode_id) FROM Episode AS T1 INNER JOIN Award AS T2 ON T1.episode_id = T2.episode_id WHERE strftime('%Y', T1.air_date) = '1998' AND T2.organization = 'International Monitor Awards' AND T2.result = 'Winner'
Database: law_episode
Question: How many times did the episode titled "Agony" win an award?
Evidence: titled "Agony" refers to title = 'Agony'; win an award refers to result = 'Winner'
SQL: 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'
Database: law_episode
Question: 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.
Evidence: 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))
SQL: 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'
Database: law_episode
Question: What are the keywords of the episode which received the 2nd-highest number of votes?
Evidence: the 2nd-highest number of votes refers to second max(votes)
SQL: 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
Database: law_episode
Question: How many awards did the "Agony" win?
Evidence: the "Agony" refers to title = 'Agony'; win refers to result = 'Winner'
SQL: 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'
Database: law_episode
Question: Who is the narrator of the "Flight" episode?
Evidence: who refers to name; narrator refers to role = 'Narrator'; the "Flight" episode refers to title = 'Flight'
SQL: 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'
Database: law_episode
Question: In which organization did Constantine Makris win the most awards?
Evidence: win refers to result = 'Winner'; the most awards refers to max(count(award_id))
SQL: 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
Database: law_episode
Question: Who is the stunt coordinator in episode 3?
Evidence: who refers to name; stunt coordinator refers to role = 'stunt coordinator'
SQL: 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'
Database: law_episode
Question: How many people were not credited at the end of the "Admissions" episode?
Evidence: not credited refers to credited = ''; the "Admissions" episode refers to title = 'Admissions'
SQL: 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'
Database: law_episode
Question: What is the title of the episode that has the highest number of crews in the Art Department?
Evidence: the highest number of crews refers to max(count(person_id)); in the Art Department refers to category = 'Art Department'
SQL: 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
Database: law_episode
Question: How many roles did Julia Roberts play in the series?
SQL: 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'
Database: law_episode
Question: What are the titles of the top 3 episodes that received no less than 30 votes in its 10-star rating?
Evidence: no less than 30 votes refers to votes > = 30; 10-star rating refers to stars = 10
SQL: 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
Database: law_episode
Question: Who is the youngest person to ever play a "clerk" role in the series?
Evidence: who refers to name; the youngest person refers to max(birthdate); a "clerk" role refers to role = 'Clerk'
SQL: 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
Database: law_episode
Question: How many people did not enjoy the finale episode?
Evidence: did not enjoy refers to stars = 1; the finale episode refers to episode = 24
SQL: 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
Database: law_episode
Question: List the names of all the cast members in the series.
Evidence: cast member refers to category = 'Cast'
SQL: SELECT T2.name FROM Credit AS T1 INNER JOIN Person AS T2 ON T2.person_id = T1.person_id WHERE T1.category = 'Cast'
Database: law_episode
Question: Who is the person who appeared the most in the series? Calculate in percentage how many times he or she appeared.
Evidence: 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%
SQL: 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
Database: law_episode
Question: Which episodes of the Law & Order have been nominated for the Primetime Emmy Awards?
Evidence: episode refers to award; the Primetime Emmy Awards refers to award_category like 'Primetime Emmy'
SQL: SELECT DISTINCT episode_id FROM Award WHERE award_category = 'Primetime Emmy'
Database: law_episode
Question: How many episodes have not won any Law & Order series awards?
Evidence: have not won any award refers to Result = 'Nominee'
SQL: SELECT COUNT(award_id) FROM Award WHERE Result = 'Nominee'
Database: law_episode
Question: What roles have not been credited at the end of the episodes?
Evidence: have not been credited refers to credited = ''
SQL: SELECT DISTINCT role FROM Credit WHERE credited = 'false'
Database: law_episode
Question: What is the title of the 3 worst rated episodes?
Evidence: worst rated refers to min(rating)
SQL: SELECT title FROM Episode ORDER BY rating LIMIT 3
Database: law_episode
Question: What is the full place of birth of Rene Chenevert Balcer?
Evidence: full place of birth refers to birth_place, birth_region; Rene Chenevert Balcer refers to birth_name = 'Rene Chenevert Balcer'
SQL: SELECT birth_place, birth_region FROM Person WHERE birth_name = 'Rene Chenevert Balcer'