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: Please list all the female students that have filed for bankruptcy.
Evidence: females students have filed for bankruptcy refers to name that appeared in both filed_for_bankrupcy and male tables
SQL: SELECT name FROM filed_for_bankrupcy 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: What is the percentage of male students in the navy department?
Evidence: in the navy department refers to organ = 'navy'; percentage refers to DIVIDE(COUNT(name where organ = 'navy'), COUNT(name))
SQL: SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT 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: What is the average time for a disabled student to be absent from school?
Evidence: average time 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: Name all students enlisted in the foreign legion.
Evidence: in the foreign legion organ = 'foreign_legion';
SQL: SELECT name FROM enlist WHERE 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: Does student348 have a due payment?
Evidence: payment due refers to bool = 'pos' means the student has payment due , bool = 'neg' means the student does not have payment due;
SQL: SELECT bool FROM no_payment_due WHERE name = 'student348'
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 is student829 enrolled in?
SQL: SELECT school FROM enrolled WHERE name = 'student829'
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 months has student217 been absent?
SQL: SELECT month FROM longest_absense_from_school WHERE name = 'student217'
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 all students that have been absent for 6 months.
Evidence: absent for 6 months `month` = 6;
SQL: SELECT 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 organization did student285 enlist?
SQL: SELECT organ FROM enlist WHERE name = 'student285'
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: Is student281 disabled and which school is the student enrolled in?
SQL: SELECT T2.name, T1.school FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.name = 'student281'
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 all students in the air force and which school they were enrolled at.
Evidence: in the air force refers to organ = 'air_force';
SQL: SELECT T1.name, T1.school FROM enrolled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.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: List 10 students that have no due payments and are not males.
Evidence: no due payments refers to bool = 'neg'; not males refers to not in male table
SQL: SELECT T1.name FROM no_payment_due AS T1 INNER JOIN person AS T2 ON T1.`name` = T2.`name` WHERE T2.`name` NOT IN ( SELECT name FROM male ) AND T1.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: Name 5 students with due payments that are enlisted alongside which organization they were enlisted.
Evidence: with due payments refers to bool = 'pos'; organization refers to organ
SQL: SELECT T2.organ, T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.bool = 'pos' LIMIT 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: Name all disabled students that are enrolled in SMC.
Evidence: enrolled in SMC refers to school = 'smc';
SQL: SELECT T2.name FROM enrolled AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc'
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 that filed for bankruptcy are also in the foreign legion?
Evidence: in the foreign legion refers to organ = 'foreign_legion';
SQL: SELECT T2.name FROM enlist AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.`name` = T2.`name` WHERE T1.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: How many male students have no due payments?
Evidence: have no due payments refers to bool = 'neg';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.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: Which students that are in the marines have been absent for 6 months?
Evidence: in the marines refers to organ = 'marines'; absent for 6 months refers to month = 6
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'marines' AND T1.`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: How many students from SMC are unemployed?
Evidence: from SMC refers to school = 'smc';
SQL: SELECT T2.name FROM enrolled AS T1 INNER JOIN unemployed AS T2 ON T1.`name` = T2.`name` WHERE T1.school = 'smc'
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 there that have been absent for 6 months?
Evidence: absent for 6 months refers to month = 6;
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T1.`name` = T2.name WHERE T1.`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: Count the number of students from UCSD enlisted in the peace corps.
Evidence: in the peace corps refers to organ = 'peace_corps'; from UCSD refers to school = 'ucsd';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.`name` = T2.`name` WHERE T2.school = 'ucsd' AND T1.organ = 'peace_corps'
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: Student21 is enlisted in which organization and has the student been absent?
Evidence: organization refers to organ
SQL: SELECT T2.month, T1.organ FROM enlist AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.`name` = T2.`name` WHERE T1.name = 'student21'
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 ratio of students who are enlisted in foreign legions that have a due payment?
Evidence: have a due payment refers to bool = 'pos'; in foreign legions refers to organ = 'foreign_legion'; ratio refers to DIVIDE(COUNT(bool = 'pos'), COUNT(bool = 'neg'))
SQL: SELECT CAST(SUM(IIF(T1.bool = 'pos', 1, 0)) AS REAL) * 100 / SUM(IIF(T1.bool = 'neg', 1, 0)) FROM no_payment_due 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: What percentage of students who enlisted in the navy make up the number of students enrolled in OCC?
Evidence: in the navy refers to organ = 'navy'; enrolled in OCC refers to school = 'occ'
SQL: SELECT CAST(SUM(IIF(T1.school = 'occ', 1.0, 0)) AS REAL) * 100 / COUNT(T1.name) FROM enrolled 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: List out student IDs that have the longest absence duration from school.
Evidence: longest absence duration 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: What is the total number of students in the school?
SQL: SELECT COUNT(name) FROM person
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 students absence duration from school?
Evidence: longest students absence duration MAX(month)
SQL: SELECT name, month 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 were absence for 4 month?
Evidence: absence for 4 month refers to month = 4;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month = 4
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 number of unemployed and bankrupt students?
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy 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: Does disable students join organization. If yes, please indicate the organization joined by the students.
Evidence: organization refers to organ
SQL: SELECT DISTINCT T2.organ FROM disabled AS T1 INNER JOIN enlist 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 and bankrupt students that have payment dues?
Evidence: have payment dues refers to bool = 'pos'
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name INNER JOIN no_payment_due AS T3 ON T2.name = T3.name WHERE T3.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 check if student 124 is disabled male.
Evidence: if student name appear in disabled then student is disabled and vice versa; if student name appear in male then student is male and vice versa
SQL: SELECT IIF(T2.name IS NULL, 'female', 'male') FROM male AS T1 LEFT JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.name = 'student124'
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 employment, disability, gender and school debt status for student180 and student117?
Evidence: school debt status refers to bool; bool = 'pos' means has payment due; bool = 'neg' means doesn't has payment due; student appear in male.name means he is a male; student does not appear in male.name means she is a female;
SQL: SELECT ( SELECT COUNT(name) FROM disabled WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM unemployed WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM male WHERE name IN ('student180', 'student117') ), ( SELECT COUNT(name) FROM no_payment_due WHERE name IN ('student180', 'student117'))
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 joined a marines and air force organization?
Evidence: joined a marines refers to organ = 'marines'; air force organization refers to organ = 'air_force';
SQL: SELECT COUNT(name) FROM enlist WHERE organ IN ('marines', '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: List out the organization joined and school enrolled by student27, student17 and student101?
Evidence: organization joined refers to organ
SQL: SELECT T1.school, T2.organ FROM enrolled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`name` IN ('student27,student17,studetn101')
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 ratio of disable female to male students?
Evidence: ratio refers to DIVIDE(COUNT(name not from male), COUNT(name from male))
SQL: SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T2.name) FROM disabled AS T1 LEFT JOIN male 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 female students are not joining any of the organization?
Evidence: female students refers to enlist.name who are NOT in male.name
SQL: SELECT COUNT(name) FROM person WHERE name NOT IN ( SELECT name FROM male ) AND name NOT IN ( SELECT name FROM enrolled )
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 all bankrupt students that are able to make payment before due?
Evidence: make payment before due refers to bool = 'neg';
SQL: SELECT T1.name FROM filed_for_bankrupcy AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.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: What is the average absence period of a 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: What is the average of absence for an employed students?
Evidence: average refers to DIVIDE(SUM(month), COUNT(name))
SQL: SELECT AVG(month) FROM longest_absense_from_school WHERE name NOT IN ( SELECT name FROM unemployed )
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 average absence period of a disabled student?
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