1sf/bird-sql-train-with-schema huggingface dataset:
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 organization does student 313 belong to?
Evidence: organization refers to organ
SQL: SELECT organ FROM enlist WHERE name = 'studenT113'
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 enlisted in the fire-department?
Evidence: enlisted in the fire-department refers to organ = 'fire_department';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'fire_department'
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 who 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: How many students have been absent above 2 months?
Evidence: absent above 2 months refers to month > 2;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 2
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: State the number of students do not have payment due.
Evidence: do not have payment due refers to bool = 'neg';
SQL: SELECT COUNT(name) FROM no_payment_due WHERE bool = 'neg'
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: Give the number of students who have payment due.
Evidence: who have payment due refers to bool = 'pos';
SQL: SELECT COUNT(name) FROM no_payment_due WHERE 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: Mention the name of disabled students who have never been absent from school.
Evidence: never been absent from school refers to month = 0
SQL: SELECT T1.name FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T2.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: How many unemployed students are enlisted in the navy organization?
Evidence: enlisted in the navy organization refers to organ = 'navy';
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.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: Count the number of male students who belong to foreign legion.
Evidence: belong to foreign legion refers to organ = 'foreign_legion';
SQL: SELECT COUNT(T1.name) FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'foreign_legion'
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: List out the number of female students who enlisted in the air force.
Evidence: enlisted in the air force refers to organ = 'air_force';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'air_force' AND 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: State name of disabled students who have the longest duration of absense from school.
Evidence: longest duration of absense refers to MAX(month)
SQL: SELECT T1.name FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name ORDER BY T2.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: State the unemployed students who enlisted in marines.
Evidence: enlisted in marines refers to organ = 'marines';
SQL: SELECT T1.name FROM unemployed AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'
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: Calculate the average duration of absense of disabled students.
Evidence: average refers to DIVIDE(SUM(month), COUNT(name))
SQL: SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled 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 percentage of unemployed students who have been absent for 5 months from school?
Evidence: percentage refers to DIVIDE(COUNT(month > 5), COUNT(month))
SQL: SELECT CAST(SUM(IIF(T1.month > 5, 1, 0)) AS REAL) * 100 / COUNT(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN unemployed 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: How many unemployed disabled students have been absent for 8 months from school?
Evidence: absent for 8 months refers to month = 8;
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name INNER JOIN disabled AS T3 ON T2.name = T3.name WHERE T1.month = 8
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: State name of unemployed students who have the longest duration of absense from school.
Evidence: longest duration of absense refers to MAX(month)
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name 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: Mention the name of unemployed students who have never been absent from school.
Evidence: have never been absent from school refers to month = 0
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed 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: How many disabled students have been absent for 3 months from school?
Evidence: have been absent for 3 months from school refers to month = 3
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 = 3
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: Mention the name of students who filed for bankruptcy and have never been absent from school.
Evidence: have never been absent refers to month = 0;
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy 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: State name of students who filed for bankruptcy and have the longest duration of absense from school.
Evidence: longest duration of absense refers to MAX(month)
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name 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: What is the gender of student1000?
Evidence: student name appear in Male table means student is a male, student does not appear in Male table means student is a female
SQL: SELECT IIF(T.result = 0, 'female', 'male') AS re FROM ( SELECT COUNT(name) AS result FROM male WHERE name = 'studenT1000' ) T
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 disabled?
SQL: SELECT COUNT(name) FROM disabled
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 been absents for more than 6 months?
Evidence: absents for more than 6 months refers to month > 6
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 6
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 students have absents the most?
Evidence: absents the most refers to MAX(month)
SQL: SELECT name FROM longest_absense_from_school WHERE month = ( 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 are enlisted in the army?
Evidence: enlisted in the army refers to organ = 'army';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'army'
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: Find the average number of absences for each student.
Evidence: average refers to DIVIDE(SUM(month), COUNT(name))
SQL: SELECT AVG(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: Sum up the number of students enlisted in foreign legion, peace corps and army.
Evidence: enlisted in foreign legion refers to organ = 'foreign_legion'; peace corps refers to organ = 'peace_corps'; army refers to organ = 'army'
SQL: SELECT COUNT(name) FROM enlist WHERE organ IN ('army', 'peace_corps', 'foreign_legion')
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 enlisted in marines, how many of them are disabled?
Evidence: enlisted in marines refers to organ = 'marines';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.organ = 'marines'
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 enrolled in smc during month 1?
Evidence: smc refers to school = 'smc';
SQL: SELECT COUNT(name) FROM enrolled WHERE school = 'smc' AND month = 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 students enlist in the air force organization?
Evidence: organization refers to organ; organ = 'air_force';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'air_force'
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 organization enlisted by student168?
Evidence: organization refers to organ; student168 is a name of student;
SQL: SELECT organ FROM enlist WHERE name = 'student168'
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 male students joined an organization?
Evidence: organization refers to organ; disabled male students refers to disabled.name who are IN male.name;
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name INNER JOIN enlist AS T3 ON T3.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: Please provide a disability breakdown for each school.
Evidence: disability breakdown refers to the number of disabled students;
SQL: SELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name GROUP BY T1.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: Please provide a gender breakdown for each organization.
Evidence: gender breakdown refers to the number of male and female; male are mentioned in male.name; female refers to enlist.name who are NOT in male.name; organization refers to organ;
SQL: SELECT IIF(T2.name IS NULL, 'female', 'male') AS gender FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name GROUP BY T1.organ
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: List out student names that enrolled in two schools and two organizations?
Evidence: enrolled in two schools refers to COUNT(school) = 2; two organizations refers to COUNT(organ) = 2;
SQL: SELECT T.name FROM ( SELECT T1.name, COUNT(T1.organ) AS num FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num = 2
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 percentage difference between month 0 absence and month 9 absence?
Evidence: percentage difference = CONCAT(DIVIDE(MULTIPLY(SUBTRACT(COUNT(name WHERE month = 0), COUNT(name WHERE month = 9)), 100), COUNT(name WHERE month = 0)),'%');
SQL: SELECT CAST(((SUM(IIF(month = 0, 1, 0)) - SUM(IIF(month = 9, 1, 0)))) AS REAL) * 100 / SUM(IIF(month = 0, 1, 0)) 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: Which school have the highest student enrollment? How many of those students are filed for bankruptcy?
Evidence: highest student enrollment refers to MAX(COUNT(school));
SQL: SELECT T.school, num FROM ( SELECT T1.school, COUNT(T2.name) AS num FROM enrolled AS T1 LEFT JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name GROUP BY T1.school ) T ORDER BY T.num 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 students is disabled and unemployed at the same time?
Evidence: students who are disabled and unemployed at the same time refers to disabled.name = unemployed.name;
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.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: List out students that enrolled in occ school and enlisted in a fire department.
Evidence: occ school refers to school = 'occ'; department refers to organ; organ = 'fire_department';
SQL: SELECT T1.name FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T2.name = T1.name WHERE T2.school = 'occ' AND T1.organ = 'fire_department'
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 male students are unemployed, disable and were absent for 5 month?
Evidence: male students are mentioned in male.name; unemployed and disabled refers to unemployed.name = disabled.name; absent for 5 month refers to month = 5;
SQL: SELECT T1.name FROM unemployed AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name INNER JOIN longest_absense_from_school AS T3 ON T3.name = T2.name WHERE T3.month = 5