1sf/bird-sql-train-with-schema huggingface dataset:
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Give the title of the episode won in Primetime Emmy Awards 2009.
Evidence: won refers to result = 'Winner'; in Primetime Emmy Awards refers to organization = 'Primetime Emmy Awards'; 2009 refers to year = 2009
SQL: SELECT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.organization = 'Primetime Emmy Awards' AND T1.year = 2009 AND T1.result = 'Winner';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List down the episode ID of episodes aired in 2008 with 5 stars and below.
Evidence: aired in 2008 refers to air_date LIKE '2008%'; 5 stars and below refers to stars < 5
SQL: SELECT DISTINCT T1.episode_id FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T2.stars < 5;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Among the episode with highest votes, what is the category credited to Carlton Batten?
Evidence: highest votes refers to max(votes); to Carlton Batten refers to person = 'Carlton Batten'
SQL: SELECT T2.category FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.person = 'Carlton Batten' AND T2.credited = 'true' ORDER BY T1.votes DESC LIMIT 1;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Among the episodes aired in 2008 with votes ranges from 920 to 950, list their percent.
Evidence: aired in 2008 refers to air_date LIKE '2008%'; votes ranges from 920 to 950 refers to votes BETWEEN 920 AND 950
SQL: SELECT T2.percent FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 4) = '2008' AND T1.votes BETWEEN 950 AND 960;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List the episode ID and title of episode where casting was credited to Bonita Pietila.
Evidence: was credited refers to credited = 'true'; to Bonita Pietila refers to person = 'Bonita Pietila'
SQL: SELECT T1.episode_id, T1.title FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'true' AND T2.person = 'Bonita Pietila' AND T2.role = 'casting';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: In episode nominated in Annie Awards, how many of the episodes have a percent greater than 6?
Evidence: nominated refers to result = 'Nominee'; Annie Awards refers to organization = 'Annie Awards'; percent greater than 6 refers to percent > 6
SQL: SELECT COUNT(*) FROM Award AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T1.organization = 'Annie Awards' AND T1.result = 'Nominee' AND T2.percent > 6;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What is the title of episode nominated for WGA Award (TV) with votes greater than 1000?
Evidence: nominated refers to result = 'Nominee'; WGA Award (TV) refers to award_category = 'WGA Award (TV)'; votes greater than 1000 refers to votes > 1000
SQL: SELECT DISTINCT T2.title FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.votes > 1000 AND T1.award_category = 'WGA Award (TV)' AND T1.result = 'Nominee';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: Among the people in Animation Department, who are credited for additional time in the episode titled by "How the Test Was Won"?
Evidence: Animation Department refers to category = 'Animation Department'; credited refers to credited = 'true'; for additional timer refers to role = 'additional timer'
SQL: SELECT T2.person FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T1.title = 'How the Test Was Won' AND T2.role = 'additional timer' AND T2.credited = 'true' AND T2.category = 'Animation Department';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List the stars of episodes aired in November 2008.
Evidence: in November 2008 refers to air_date LIKE '2008-11%'
SQL: SELECT T2.stars FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE SUBSTR(T1.air_date, 1, 7) = '2008-11';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: What is the title of episode with 5 stars and nominated for Prism Award which is aired on April 19, 2009?
Evidence: 5 stars refers to stars = 5; nominated refers to result = 'Nominee'; Prism Award refers to award_category = 'Prism Award'; on April 19 2009 refers to air_date = '2009-04-19'
SQL: SELECT T3.title FROM Award AS T1 INNER JOIN Vote AS T2 ON T1.episode_id = T2.episode_id INNER JOIN Episode AS T3 ON T1.episode_id = T3.episode_id WHERE T3.air_date = '2009-04-19' AND T1.award_category = 'Prism Award' AND T2.stars = 5 AND T1.result = 'Nominee';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: In episode with the highest votes, list the category of awards it is nominated for.
Evidence: highest votes refers to max(votes); nominated refers to result = 'Nominee'
SQL: SELECT T1.award_category FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T1.result = 'Nominee' ORDER BY T2.votes DESC LIMIT 1;
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: In episodes aired in 2009, how many of them are credited to Sam Im for additional timer?
Evidence: in 2009 refers to air_date LIKE '2009%'; credited refers to credited = 'true'; Sam Im refers to person = 'Sam Im'; for additional timer refers to role = 'additional timer'
SQL: SELECT COUNT(*) FROM Episode AS T1 INNER JOIN Credit AS T2 ON T1.episode_id = T2.episode_id WHERE T2.credited = 'true' AND T2.person = 'Sam Im' AND SUBSTR(T1.air_date, 1, 4) = '2009' AND T2.role = 'additional timer';
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: List the title of the episode with stars greater than the 70% of average stars of all episodes.
Evidence: stars greater than the 70% of average stars refers to stars > multiply(avg(stars), 0.7)
SQL: SELECT DISTINCT T1.title FROM Episode AS T1 INNER JOIN Vote AS T2 ON T2.episode_id = T1.episode_id WHERE T2.stars > 0.7 * ( SELECT AVG(stars) FROM Vote );
Database: simpson_episodes
Tables: Episode, Person, Award, Character_Award, Credit, Keyword, Vote
Columns (table index, column name): -1, *, 0, episode_id, 0, season, 0, episode, 0, number_in_series, 0, title, 0, summary, 0, air_date, 0, episode_image, 0, rating, 0, votes, 1, name, 1, birthdate, 1, birth_name, 1, birth_place, 1, birth_region, 1, birth_country, 1, height_meters, 1, nickname, 2, award_id, 2, organization, 2, year, 2, award_category, 2, award, 2, person, 2, role, 2, episode_id, 2, season, 2, song, 2, result, 3, award_id, 3, character, 4, episode_id, 4, category, 4, person, 4, role, 4, credited, 5, episode_id, 5, keyword, 6, episode_id, 6, stars, 6, votes, 6, percent
Question: In year 2009, what is the percentage of the episode titled by "Gone Maggie Gone" being nominated?
Evidence: being nominated refers to result = 'Nominee'; percentage = divide(count(result = 'Nominee'), count(result)) * 100%
SQL: SELECT CAST((SUM(CASE WHEN T1.result = 'Nominee' THEN 1 ELSE 0 END) - SUM(CASE WHEN T1.result = 'Winner' THEN 1 ELSE 0 END)) AS REAL) * 100 / COUNT(T1.result) FROM Award AS T1 INNER JOIN Episode AS T2 ON T1.episode_id = T2.episode_id WHERE T2.title = 'Gone Maggie Gone' AND T1.year = 2009;
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: How many students have never been absent from school?
Evidence: have never been absent refers to `month` = 0;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE `month` = 0
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: For the students who have been absent from school for the longest time, how many months have they been absent?
Evidence: absent from school for the longest time refers to MAX(month)
SQL: SELECT MAX(month) FROM longest_absense_from_school
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: How many students belong to the navy department?
Evidence: belong to the navy department refers to organ = 'navy';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'navy'
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Among the students that have been absent from school for more than 5 months, how many of them are male?
Evidence: absent from school for more than 5 months refers to `month`  > = 5;
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` >= 5
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Please list the names of the male students that belong to the navy department.
Evidence: belong to the navy department refers to organ = 'navy';
SQL: SELECT T1.name FROM enlist AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy'
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Among the students that have filed for bankruptcy, how many of them have been absent from school for over 5 months?
Evidence: absent from school for over 5 months refers to `month` > 5;
SQL: SELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.`name` = T2.`name` WHERE T2.`month` > 5
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Among the students from the navy department, how many of them have payment due?
Evidence: from the navy department refers to organ = 'navy'; have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name` WHERE T1.organ = 'navy' AND T2.bool = 'pos'
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Please list the male students that are disabled and have filed for bankruptcy.
Evidence: male students that are disabled and have filed for bankruptcy refers to name that appeared in all three male, disabled and filed_for_bankrupcy tables.
SQL: SELECT T1.name, T2.name, T3.name FROM disabled AS T1 INNER JOIN male AS T2 ON T1.`name` = T2.`name` INNER JOIN filed_for_bankrupcy AS T3 ON T1.`name` = T3.`name`
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: How many female students are disabled?
Evidence: females students are disabled refers to name that appeared in both disabled and male tables
SQL: SELECT COUNT(name) FROM disabled WHERE name NOT IN ( SELECT name FROM male )
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: How many students are unemployed and have payment due?
Evidence: are unemployed and have payment due refers to
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name`
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: What is the longest time for a student from the navy department to be absent from school?
Evidence: navy department refers to organ = 'navy'; longest time to be absent from school refers to MAX(month)
SQL: SELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'navy' ORDER BY T1.`month` DESC LIMIT 1
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: How many disabled students have never been absent from school?
Evidence: never been absent from school refers to month = 0
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 0
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Please list the departments the students are absent from school for 9 months are in.
Evidence: absent from school for 9 months refers to month = 9
SQL: SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9
Database: student_loan
Tables: bool, person, disabled, enlist, filed_for_bankrupcy, longest_absense_from_school, male, no_payment_due, unemployed, enrolled
Columns (table index, column name): -1, *, 0, name, 1, name, 2, name, 3, name, 3, organ, 4, name, 5, name, 5, month, 6, name, 7, name, 7, bool, 8, name, 9, name, 9, school, 9, month
Question: Which department has the most disabled students?
Evidence: department refers to organ; most disabled students refers to MAX(disabled.name)
SQL: SELECT T2.organ, COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` GROUP BY T2.organ ORDER BY COUNT(T1.name) DESC LIMIT 1