db_id stringlengths 4 31 | SQL stringlengths 18 1.45k | input_sequence stringlengths 148 11k | question stringlengths 16 325 |
|---|---|---|---|
law_episode | select title from episode order by rating limit 3 | Question: what is the title of the 3 worst rated episodes? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, heigh... | what is the title of the 3 worst rated episodes? |
law_episode | select birth_place, birth_region from person where birth_name = 'rene chenevert balcer' | Question: what is the full place of birth of rene chenevert balcer? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_count... | what is the full place of birth of rene chenevert balcer? |
law_episode | select name from person where birth_country = 'usa' | Question: what is the name of the actors born in the usa? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height... | what is the name of the actors born in the usa? |
law_episode | select t1.title from episode as t1 inner join vote as t2 on t1.episode_id = t2.episode_id where t2.stars = 1 | Question: what is the title of the episodes that were least enjoyed? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_coun... | what is the title of the episodes that were least enjoyed? |
law_episode | 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' | Question: what are the names of the two people who won an award for their role as directors? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, ... | what are the names of the two people who won an award for their role as directors? |
law_episode | select sum(t2.votes) from episode as t1 inner join vote as t2 on t1.episode_id = t2.episode_id where t1.title = 'juvenile' | Question: how many votes did the episode titled juvenile get? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, he... | how many votes did the episode titled juvenile get? |
law_episode | 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' | Question: in which episodes was anthony azzara not credited? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, hei... | in which episodes was anthony azzara not credited? |
law_episode | 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' | Question: in what year did the episodes titled dwb get an award? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country,... | in what year did the episodes titled dwb get an award? |
law_episode | 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' | Question: in which region were the assistant location managers born? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_coun... | in which region were the assistant location managers born? |
law_episode | 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' | Question: how many stars did the episodes in which donna villella worked? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth... | how many stars did the episodes in which donna villella worked? |
law_episode | 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' | Question: what role was julia roberts nominated for? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_mete... | what role was julia roberts nominated for? |
law_episode | 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 | Question: what role does the tallest person play? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_meters,... | what role does the tallest person play? |
law_episode | 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 | Question: what is the title of the episode with the most nominations? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_cou... | what is the title of the episode with the most nominations? |
law_episode | 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' | Question: what was the rating of the episodes that jace alexander worked on? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, bi... | what was the rating of the episodes that jace alexander worked on? |
law_episode | 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 | Question: what are the names of all the people who worked on episode 19 of season 9? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_re... | what are the names of all the people who worked on episode 19 of season 9? |
law_episode | 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' | Question: what is the average star rating of the episodes jim bracchitta has worked on? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth... | what is the average star rating of the episodes jim bracchitta has worked on? |
law_episode | 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' | Question: what percentage of people have worked on the true north episode as additional crew? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place,... | what percentage of people have worked on the true north episode as additional crew? |
law_episode | 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 | Question: write down the title, summary, and air date of the episode that garnered 72 10-star votes. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth... | write down the title, summary, and air date of the episode that garnered 72 10-star votes. |
law_episode | 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 | Question: how many 6-star votes did episode 12 get? please include the air date and rating. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, b... | how many 6-star votes did episode 12 get? please include the air date and rating. |
law_episode | 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' | Question: who is the winner of the best television episode award for the edgar category in 2000? include his or her name and role. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name... | who is the winner of the best television episode award for the edgar category in 2000? include his or her name and role. |
law_episode | 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' | Question: write down the organization, year, award, and award category in which rene balcer is the winner. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name,... | write down the organization, year, award, and award category in which rene balcer is the winner. |
law_episode | select t3.years, t3.episode_id from ( select distinct t2.year as years, t2.episode_id, row_number() over (partition by t2.episode_id 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 t1.name = 'c... | Question: give me the years and episode ids in which constantine makris was the winner of the television silver gavel award at the american bar association silver gavel awards for media and the arts for two consecutive years. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, ai... | give me the years and episode ids in which constantine makris was the winner of the television silver gavel award at the american bar association silver gavel awards for media and the arts for two consecutive years. |
law_episode | 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.resul... | Question: 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? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rati... | 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? |
law_episode | 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' | Question: how many times was episode 20 of the law and order series nominated for the primetime emmy awards in 1999? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, b... | how many times was episode 20 of the law and order series nominated for the primetime emmy awards in 1999? |
law_episode | 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' an... | Question: 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. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyw... | 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. |
law_episode | 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' | Question: list the titles and air dates of episodes that were produced by billy fox. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_re... | list the titles and air dates of episodes that were produced by billy fox. |
law_episode | 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' | Question: among the american casts, how many were uncredited on episode id tt0629228? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_r... | among the american casts, how many were uncredited on episode id tt0629228? |
law_episode | 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' | Question: what was the role of jason kuschner in episode 9? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, heig... | what was the role of jason kuschner in episode 9? |
law_episode | 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' | Question: who played the role of the 'president of nbc west coast' in the first episode? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birt... | who played the role of the 'president of nbc west coast' in the first episode? |
law_episode | 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 | Question: list down the titles of the top 3 episodes, from highest to lowest, in terms of their weighted stars. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_... | list down the titles of the top 3 episodes, from highest to lowest, in terms of their weighted stars. |
law_episode | select cast(sum(case when t2.category = 'cast' then 1 else 0 end) as real) * 100 / count(t2.category), t1.role from award as t1 inner join credit as t2 on t1.episode_id = t2.episode_id inner join episode as t3 on t2.episode_id = t3.episode_id inner join person as t4 on t2.person_id = t4.person_id where t3.episode = 2 a... | Question: what is the ratio of american casts on episode 2 of the series? please include their roles. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birt... | what is the ratio of american casts on episode 2 of the series? please include their roles. |
law_episode | 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' | Question: how many people from canada are nominated for an award? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country... | how many people from canada are nominated for an award? |
law_episode | 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' | Question: how many episodes are credited to jerry orbach? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height... | how many episodes are credited to jerry orbach? |
law_episode | 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 | Question: list out all the credit names for episode 9. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_me... | list out all the credit names for episode 9. |
law_episode | 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') | Question: list out all award titles nominated for episode 20. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, he... | list out all award titles nominated for episode 20. |
law_episode | select t1.name from person as t1 inner join award as t2 on t1.person_id = t2.person_id group by t2.role having count(t2.award_id) > 1 | Question: which role have won at least two awards for the entire season and list out the name? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place... | which role have won at least two awards for the entire season and list out the name? |
law_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' | Question: list out director names that received an award along with the episode number. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth... | list out director names that received an award along with the episode number. |
law_episode | select t1.episode from episode as t1 inner join award as t2 on t1.episode_id = t2.episode_id where t2.result = 'nominee' | Question: which episodes are nominated for an awards but not win? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country... | which episodes are nominated for an awards but not win? |
law_episode | select sum(rating) / count(episode_id) from episode where season = 9 | Question: what is the average rating for each episode in season 9? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_countr... | what is the average rating for each episode in season 9? |
law_episode | 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 | Question: what is the difference of 10 stars votes between the first episode and the last episode? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_p... | what is the difference of 10 stars votes between the first episode and the last episode? |
law_episode | 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 | Question: what is the episode rating with the most award won? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, he... | what is the episode rating with the most award won? |
law_episode | 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 | Question: how many credits have been displayed from episode 1 until 10? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_c... | how many credits have been displayed from episode 1 until 10? |
law_episode | select t1.episode from episode as t1 inner join keyword as t2 on t1.episode_id = t2.episode_id where t2.keyword = 'mafia' | Question: what is the episode that has mafia keyword? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_met... | what is the episode that has mafia keyword? |
law_episode | 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 | Question: what is the average star with highest percentage for episodes that have received award? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_pl... | what is the average star with highest percentage for episodes that have received award? |
law_episode | select sum(t1.rating) / count(t1.episode) from episode as t1 inner join award as t2 on t1.episode_id = t2.episode_id | Question: what is the average ranking episodes that are nominated for an award? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region,... | what is the average ranking episodes that are nominated for an award? |
law_episode | 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' | Question: how many winners have been awarded a television award by the 'american bar association silver gavel awards for media and the arts'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> pers... | how many winners have been awarded a television award by the 'american bar association silver gavel awards for media and the arts'? |
law_episode | select birth_country from person where name = 'michael preston' | Question: which continent was michael preston born on? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_me... | which continent was michael preston born on? |
law_episode | 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' | Question: who was the nominee playing the role of katrina ludlow in the law & order series? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, b... | who was the nominee playing the role of katrina ludlow in the law & order series? |
law_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' | Question: who played the role of a teleplay in the episode that won 'best television episode'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place... | who played the role of a teleplay in the episode that won 'best television episode'? |
law_episode | select t2.birthdate from award as t1 inner join person as t2 on t1.person_id = t2.person_id where t1.role = 'writer' | Question: what is the date of birth of the actor who played the role of a 'writer'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_reg... | what is the date of birth of the actor who played the role of a 'writer'? |
law_episode | 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' | Question: which episode was nominated for the award for 'outstanding costume design for a series'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_p... | which episode was nominated for the award for 'outstanding costume design for a series'? |
law_episode | 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 | Question: which episode has the highest total number of viewer votes? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_cou... | which episode has the highest total number of viewer votes? |
law_episode | 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' | Question: who was the actor who was portraying 'alex brown' and has been credited? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_regi... | who was the actor who was portraying 'alex brown' and has been credited? |
law_episode | 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' | Question: 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'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> perso... | 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'? |
law_episode | select t2.keyword from episode as t1 inner join keyword as t2 on t1.episode_id = t2.episode_id where t1.title = 'shield' | Question: what are the keywords of the episode 'shield'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country, height_... | what are the keywords of the episode 'shield'? |
law_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 t2.height_meters > 1.80 | Question: who are the actors with a height of over 1.80m in an episode that won an award? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, bir... | who are the actors with a height of over 1.80m in an episode that won an award? |
law_episode | 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') | Question: which episode has the two keywords 'nun' and 'priest'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region, birth_country,... | which episode has the two keywords 'nun' and 'priest'? |
law_episode | 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 | Question: which episode number has the second highest positive viewer comments and has been awarded 'best television episode'? | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, bi... | which episode number has the second highest positive viewer comments and has been awarded 'best television episode'? |
law_episode | 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 | Question: please list any three episodes that were most enjoyed by the viewers. | Tables: Episode -> episode_id, series, season, episode, number_in_series, title, summary, air_date, episode_image, rating, votes. Keyword -> episode_id, keyword. Person -> person_id, name, birthdate, birth_name, birth_place, birth_region,... | please list any three episodes that were most enjoyed by the viewers. |
synthea | 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' | Question: according to the observation on 2008/3/11, what was the height of elly koss? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marita... | according to the observation on 2008/3/11, what was the height of elly koss? |
synthea | select sum(case when strftime('%y', t2.date) = '2009' then t2.value end) - sum(case when strftime('%y', t2.date) = '2008' then t2.value end) as increase , 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 = 'body height' | Question: by how much did elly koss's weight increase from the observation in 2008 to the observation in 2009? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last... | by how much did elly koss's weight increase from the observation in 2008 to the observation in 2009? |
synthea | 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 | Question: during all the observations of elly koss, what was the highest systolic blood pressure observed? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, su... | during all the observations of elly koss, what was the highest systolic blood pressure observed? |
synthea | 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' | Question: for how many times had elly koss have her systolic blood pressure observed? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital... | for how many times had elly koss have her systolic blood pressure observed? |
synthea | select t1.first, t1.last from patients as t1 inner join observations as t2 on t1.patient = t2.patient where t2.value = ( select max(value) from observations where description = 'systolic blood pressure' ) limit 1 | Question: the highest systolic blood pressure was observed in which patient? please give his or her full name. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last... | the highest systolic blood pressure was observed in which patient? please give his or her full name. |
synthea | select strftime('%j', t2.stop) - strftime('%j', t2.start) as days from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' and t2.description like 'acetaminophen%' | Question: for how long was elly koss required to take acetaminophen? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity... | for how long was elly koss required to take acetaminophen? |
synthea | select distinct t2.description from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' | Question: please list all the medication that are prescribed to elly koss. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, eth... | please list all the medication that are prescribed to elly koss. |
synthea | select t2.reasondescription from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' and t2.description like 'acetaminophen%' | Question: why did elly koss need to take acetaminophen? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, bir... | why did elly koss need to take acetaminophen? |
synthea | select t2.description from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' and t2.reasondescription = 'streptococcal sore throat (disorder)' | Question: what medication did elly koss take when she had streptococcal sore throat? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital,... | what medication did elly koss take when she had streptococcal sore throat? |
synthea | select distinct t1.first, t1.last from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t2.description like 'acetaminophen%' | Question: please give the full names of all the patients who had been prescribed with acetaminophen. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, ... | please give the full names of all the patients who had been prescribed with acetaminophen. |
synthea | select t2.description from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' and t2.start = '2009-01-08' | Question: what was the condition of elly koss on 2009/1/8? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, ... | what was the condition of elly koss on 2009/1/8? |
synthea | select strftime('%j', t2.stop) - strftime('%j', t2.start) as days from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t1.first = 'elly' and t1.last = 'koss' and t2.description = 'cystitis' | Question: for how long did elly koss's cystitis last? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, birth... | for how long did elly koss's cystitis last? |
synthea | select avg(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 = 'body weight' | Question: according to all the observations of elly koss, what was her average weight? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marita... | according to all the observations of elly koss, what was her average weight? |
synthea | select cast(sum(case when t1.marital = 'm' then 1 else 0 end) as real) * 100 / count(distinct t1.patient) from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t2.description = 'cystitis' | Question: among all the patients who once had cystitis, what was the percentage of them being married? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix... | among all the patients who once had cystitis, what was the percentage of them being married? |
synthea | select t2.description, t2.value, t2.units from patients as t1 inner join observations as t2 on t1.patient = t2.patient where t1.prefix = 'mr.' and t1.first = 'vincent' and t1.last = 'wyman' and t2.date = '2010-08-02' and t2.description = 'body height' | Question: give the body height status of mr. vincent wyman on 2010/8/2. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnic... | give the body height status of mr. vincent wyman on 2010/8/2. |
synthea | select count(t2.patient) from patients as t1 inner join careplans as t2 on t1.patient = t2.patient where t1.prefix = 'mrs.' and t1.first = 'norman' and t1.last = 'berge' | Question: how many care plans has mrs. norman berge taken? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, ... | how many care plans has mrs. norman berge taken? |
synthea | select t2.reasondescription from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t1.prefix = 'mrs.' and t1.first = 'annabelle' and t1.last = 'pouros' and t2.start = '1970-12-19' and t2.description = 'leucovorin 100 mg injection' | Question: why did mrs. annabelle pouros take leucovorin 100 mg injection on 1970/12/19? state the reason. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suf... | why did mrs. annabelle pouros take leucovorin 100 mg injection on 1970/12/19? state the reason. |
synthea | select distinct t1.'prevalence percentage' from all_prevalences as t1 inner join conditions as t2 on lower(t1.item) = lower(t2.description) where t2.code = '64859006' | Question: what is the prevalence percentage of condition no. 64859006? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnici... | what is the prevalence percentage of condition no. 64859006? |
synthea | select distinct t1.'prevalence rate' from all_prevalences as t1 inner join conditions as t2 on lower(t1.item) = lower(t2.description) where t2.code = '368581000119106' | Question: state the prevalence rate of condition no. 368581000119106. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicit... | state the prevalence rate of condition no. 368581000119106. |
synthea | select distinct t2.description from patients as t1 inner join procedures as t2 on t1.patient = t2.patient where t1.prefix = 'ms.' and t1.first = 'jacquelyn' and t1.last = 'shanahan' and t2.date = '2009-08-09' | Question: give the procedure description of ms. jacquelyn shanahan on 2009/8/9. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race... | give the procedure description of ms. jacquelyn shanahan on 2009/8/9. |
synthea | select count(t2.billableperiod) from patients as t1 inner join claims as t2 on t1.patient = t2.patient where t1.prefix = 'ms.' and t1.first = 'abbie' and t1.last = 'cole' and t2.billableperiod between '2010-12-31' and '2012-01-01' | Question: give the number of claims did ms. abbie cole have in the year of 2011. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, rac... | give the number of claims did ms. abbie cole have in the year of 2011. |
synthea | select count(distinct t2.code) from patients as t1 inner join allergies as t2 on t1.patient = t2.patient where t1.prefix = 'mrs.' and t1.first = 'saundra' and t1.last = 'monahan' | Question: how many allergies does mrs. saundra monahan have? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender... | how many allergies does mrs. saundra monahan have? |
synthea | select t1.first, t1.last from patients as t1 inner join claims as t2 on t1.patient = t2.patient where t2.billableperiod = '1947-09-11' | Question: provide the name of the patient who had a claim on 1947/9/11. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnic... | provide the name of the patient who had a claim on 1947/9/11. |
synthea | select t2.description from patients as t1 inner join encounters as t2 on t1.patient = t2.patient where t1.prefix = 'mr.' and t1.first = 'hubert' and t1.last = 'baumbach' and t2.date = '2008-10-25' | Question: describe the encounter of mr. hubert baumbach on 2008/10/25. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnici... | describe the encounter of mr. hubert baumbach on 2008/10/25. |
synthea | select t2.description from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t1.first = 'keven' and t1.last = 'kuhn' and t2.start = '2016-09-24' and t2.stop = '2016-10-10' | Question: what kind of condition did keven kuhn have from 2016/9/24 to 2016/10/10? describe the condition. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, su... | what kind of condition did keven kuhn have from 2016/9/24 to 2016/10/10? describe the condition. |
synthea | select t2.date from patients as t1 inner join procedures as t2 on t1.patient = t2.patient where t1.prefix = 'mrs.' and t1.first = 'ira' and t1.last = 'deckow' and t2.description = 'standard pregnancy test' | Question: when did mrs. ira deckow have the standard pregnancy test? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity... | when did mrs. ira deckow have the standard pregnancy test? |
synthea | select cast(sum(strftime('%j', t2.stop) - strftime('%j', t2.start)) as real) / count(t1.patient) from patients as t1 inner join careplans as t2 on t1.patient = t2.patient where t1.prefix = 'mr.' and t1.first = 'wesley' and t1.last = 'lemke' | Question: calculate the average period of mr. wesley lemke's care plans. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethni... | calculate the average period of mr. wesley lemke's care plans. |
synthea | select cast(sum(strftime('%j', t2.stop) - strftime('%j', t2.start)) as real) / count(t2.patient) from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t1.prefix = 'ms.' and t1.first = 'angelena' and t1.last = 'kertzmann' and t2.description = 'normal pregnancy' | Question: state the average period of ms. angelena kertzmann's several normal pregnancies. | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, ma... | state the average period of ms. angelena kertzmann's several normal pregnancies. |
synthea | select patient from allergies where stop is not null group by patient order by case when substr(stop, -2, 1) != '9' then substr(stop, length(stop) - 1) + 2000 end - case when substr(start, -2, 1) = '9' then substr(start, length(start) - 1) + 1900 else substr(start, length(start) - 1) + 2000 end limit 1 | Question: what is the id of the patient who has the longest allergy period? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, et... | what is the id of the patient who has the longest allergy period? |
synthea | select count(patient) from conditions where description = 'diabetes' and strftime('%y', start) = '1988' | Question: how many patients have diabetes that started in 1988? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gen... | how many patients have diabetes that started in 1988? |
synthea | select count(patient) from allergies where description = 'allergy to eggs' | Question: how many patients are allergic to eggs? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, birthplac... | how many patients are allergic to eggs? |
synthea | select patient from conditions where start = ( select max(start) from conditions where description = 'hypertension' ) | Question: what is the id of the patient whose hypertension started most recently? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, ra... | what is the id of the patient whose hypertension started most recently? |
synthea | select description from allergies group by description order by count(description) desc limit 1 | Question: what is the most common allergy among patients? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, b... | what is the most common allergy among patients? |
synthea | select patient from observations where description = 'body height' and units = 'cm' order by value desc limit 1 | Question: what is/are the ids of the tallest patient/s? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gender, bir... | what is/are the ids of the tallest patient/s? |
synthea | select t2.description from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where t1.gender = 'f' and t1.ethnicity = 'american' group by t2.description order by count(t2.description) desc limit 1 | Question: what is the most common condition among the female americans? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnic... | what is the most common condition among the female americans? |
synthea | select count(distinct t1.patient) from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t2.description = 'ibuprofen 200 mg oral tablet' and t1.ethnicity = 'dominican' and strftime('%y', t2.start) = '2016' and strftime('%m', t2.stop) - strftime('%m', t2.start) = 1 | Question: among the patients that started taking ibuprofen 200mg oral tablet in 2016, how many dominican patients stopped taking the medicine after exactly one month? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate... | among the patients that started taking ibuprofen 200mg oral tablet in 2016, how many dominican patients stopped taking the medicine after exactly one month? |
synthea | select count(distinct t1.patient) from patients as t1 inner join conditions as t2 on t1.patient = t2.patient where description = 'pneumonia' and strftime('%y', t1.birthdate) like '192%' | Question: how many of the patients born in 1920s had pneumonia? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gen... | how many of the patients born in 1920s had pneumonia? |
synthea | select distinct t1.first, t1.last, t1.suffix from patients as t1 inner join medications as t2 on t1.patient = t2.patient where t2.description = 'yaz 28 day pack' and strftime('%y', t2.start) = '2011' | Question: what are the full names of the patients who started taking yaz 28 day pack in 2011? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden,... | what are the full names of the patients who started taking yaz 28 day pack in 2011? |
synthea | select count(distinct t1.patient) from patients as t1 inner join immunizations as t2 on t1.patient = t2.patient where t1.race = 'black' and t2.description = 'dtap' and strftime('%y', t2.date) = '2013' | Question: how many black patients were immunized with dtap in 2013? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity,... | how many black patients were immunized with dtap in 2013? |
synthea | select count(t2.patient) from all_prevalences as t1 inner join conditions as t2 on lower(t1.item) = lower(t2.description) inner join immunizations as t3 on t2.patient = t3.patient group by t2.patient order by t2.start desc, t1.'prevalence rate' desc limit 1 | Question: how many immunizations did the patient with the most prevalent condition that started recently get? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last,... | how many immunizations did the patient with the most prevalent condition that started recently get? |
synthea | select count(distinct t2.patient) from all_prevalences as t1 inner join conditions as t2 on lower(t1.item) = lower(t2.description) order by t1.'prevalence rate' desc limit 1 | Question: how many patients have the most prevalent conditions? | Tables: all_prevalences -> ITEM, POPULATION TYPE, OCCURRENCES, POPULATION COUNT, PREVALENCE RATE, PREVALENCE PERCENTAGE. patients -> patient, birthdate, deathdate, ssn, drivers, passport, prefix, first, last, suffix, maiden, marital, race, ethnicity, gen... | how many patients have the most prevalent conditions? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.