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: Among students with 1 month of absenses, how many of them are enlisted in the air force department?
Evidence: 1 month of absences refers to month = 1; department refers to organ; organ = 'air_force';
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T1.month = 1 AND 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: Provide the name of disabled male students that are unemployed.
Evidence: disabled male students that are unemployed refers to unemployed.name = male.name = disabled.name;
SQL: SELECT T2.NAME FROM unemployed AS T1 INNER JOIN male AS T2 ON T1.name = T2.name INNER JOIN disabled 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: How many unemployed students still have payment due?
Evidence: still have payment due refers to bool = 'pos'
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE 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: Which female students had never been absent?
Evidence: had never been absent refers to month = 0
SQL: SELECT T2.name FROM male 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: Which school has the highest number of disabled students?
Evidence: highest number of disabled students refers to MAX(COUNT(disabled.name))
SQL: SELECT T.school FROM ( SELECT T2.school, COUNT(T2.name) AS num FROM disabled AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name GROUP BY T2.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: List all the organisations of students who filed for bankcrupcy.
Evidence: organization refers to organ; students who filed for bankrupcy refers to file_for_bankrupcy.name
SQL: SELECT T2.organ FROM filed_for_bankrupcy 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 male students join more than one organization?
Evidence: more than one organization refers to COUNT(organ) > 1
SQL: SELECT COUNT(T.a) FROM ( SELECT COUNT(DISTINCT T1.name) AS a, COUNT(T2.organ) AS num FROM male AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name GROUP BY T1.name ) T WHERE T.num > 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: List all the navy students who are disabled.
Evidence: navy students refers to organ = 'navy'; disabled student refers to disabled.name
SQL: SELECT T1.name FROM disabled 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: How many SMC's students that absent for 7 months?
Evidence: SMC's students refers to school = 'smc'; absent for 7 months refers to month = 7
SQL: SELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name WHERE T1.school = 'smc' AND T2.month = 7
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 the disabled female students.
SQL: SELECT T1.name FROM disabled AS T1 INNER 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: Calculate the ratio between unemployed students and disabled students.
Evidence: ratio refers to DIVIDE(COUNT(name from unemployed), COUNT(name from disabled))
SQL: SELECT CAST(( SELECT COUNT(name) FROM unemployed ) AS REAL ) / ( 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: Find the percentage of male students enlisted in the fire department.
Evidence: percentage refers to DIVIDE(COUNT(organ = 'fire_department'), 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 = '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 has the longest absense from school for 5 months?
Evidence: absense from school for 5 month refers to month = 5
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE 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: How many students are enlisted in the Army organization?
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: How many students are enrolled in UCLA school?
Evidence: enrolled in UCLA refers to school = 'ucla';
SQL: SELECT COUNT(name) FROM enrolled WHERE school = 'ucla'
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 at least 5 students who has the longest absense from schoool?
Evidence: longest absense refers to MAX(month)
SQL: SELECT name FROM longest_absense_from_school ORDER BY month DESC 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: How many of the students joined two organization?
Evidence: joined two organization refers to COUNT(organ) > = 2
SQL: SELECT COUNT(name) FROM enlist WHERE organ >= 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: How many students are enlisted in the Navy organization?
Evidence: enlisted in the navy organization 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: How many male stuents do not have payment due?
Evidence: do not have payment due refers to bool = 'neg';
SQL: SELECT COUNT(T1.name) FROM male 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: How many students are enlisted in the Peace Corps organization are enrolled in UCSD school?
Evidence: enlisted in the Peace Corps refers to organ = 'peace_corps'; enrolled in UCSD school refers to school = 'ucsd';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name WHERE T1.organ = 'peace_corps' AND T2.school = 'ucsd'
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 unemployed students, how many of them have no payment due?
Evidence: have no payment due refers to bool = 'neg';


SQL: SELECT COUNT(T1.name) FROM unemployed 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: How many female students have no payment due?
Evidence: have no payment due refers to bool = 'neg'; female students refers to name NOT in male table
SQL: SELECT COUNT(name) FROM no_payment_due 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 unemployed students have never been absent?
Evidence: never been absent refers to month = 0;
SQL: SELECT COUNT(T2.name) FROM longest_absense_from_school AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.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: List at least 10 students who have no payment due and are enlisted in Fire Department organization.
Evidence: no payment due refers to bool = 'neg'; organization refers to organ; organ = 'fire_department';
SQL: SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.bool = 'neg' AND T2.organ = 'fire_department' LIMIT 10
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 enlisted in the Navy organization?
Evidence: female students refers to enlist.name who are NOT in male.name; organization refers to organ; organ = 'navy';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'navy' 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: How many unemployed students are enlisted in the Army organization?
Evidence: organization refers to organ; organ = 'army';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.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: How many unemployed students have payment due?
Evidence: have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name WHERE T1.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: List at least 5 students who have payment due and are enlisted in Peace Corps organization?
Evidence: have payment due refers to bool = 'pos'; organization refers to organ; organ = 'Peace Corps';
SQL: SELECT T1.name FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T2.organ = 'peace_corps' AND 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: How many disabled students are female?
Evidence: female refers to disabled.name who are NOT in male.name;
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 disabled students have payment due?
Evidence: have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE 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: Calculate the average number of female students who are disabled and who joined Foreign Legion organization.
Evidence: average = DIVIDE(COUNT(disabled.name who are not in male.name WHERE organ = 'foreign_legion'), COUNT(disabled.name)); female students who are disabled refers to disabled.name who are NOT in male.name; organization refers to organ; organ = 'Foreign Legion';
SQL: SELECT CAST(SUM(IIF(T3.name IS NULL, 1, 0)) AS REAL) / COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T2.name = T3.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: Calculate the ratio in percentage between the average number of female and male students who joined Fire Department organization.
Evidence: ratio = CONCAT(MULTIPLY(DIVIDE(COUNT(enlist.name WHERE organ = 'fire_department' which is NOT in male.name), COUNT(enlist.name WHERE organ = 'fire_department),'%'))) AS FEMALE; ratio = CONCAT(MULTIPLY(DIVIDE(COUNT(enlist.name WHERE organ = 'fire_department' which is IN male.name), COUNT(enlist.name WHERE organ = 'fire_department), 100))) AS MALE; female students refers to enlist.name who are NOT in male.name; male students refers to enlist.name who are IN male.name; organization refers to organ; organ = 'fire_department';
SQL: SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name), CAST(SUM(IIF(T2.name IS NOT NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE 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: How many students enlisted in the navy?
Evidence: navy 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: Calculate the percentage of students who have never been absent.
Evidence: percentage = CONCAT(DIVIDE(MULTIPLY(COUNT(name WHERE month = 0), 100), COUNT(name)),'%'); never been absent refers to month = 0;
SQL: SELECT CAST(SUM(IIF(month = 0, 1, 0)) AS REAL) * 100 / COUNT(name) 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 ratio of students who have payment due and those who do not have payment due?
Evidence: ratio =  DIVIDE(COUNT(name WHERE `bool` = 'pos'), COUNT(name WHERE `bool` = 'neg')); have payment due refers to `bool` = 'pos'; no payment due refers to `bool` = 'neg';
SQL: SELECT CAST(SUM(IIF(`bool` = 'pos', 1, 0)) AS REAL) / SUM(IIF(`bool` = 'neg', 1, 0)) FROM no_payment_due
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: Provide the students' names and schools who enrolled for 15 months.
Evidence: enrolled for 15 months refers to month = 15;
SQL: SELECT name, school FROM enrolled WHERE month = 15
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 enlisted students per organization.
Evidence: average = DIVIDE(FLOOR(COUNT(NAME), COUNT(DISTINCT organ)));
SQL: SELECT CAST(COUNT(NAME) AS REAL) * 100 / COUNT(DISTINCT organ) FROM enlist
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 down the enrolled schools and duration of student214.
Evidence: enrolled schools refers to school; duration refers to month; student214 is a name of student;
SQL: SELECT school, month FROM enrolled WHERE name = 'student214'
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 all students, calculate the percentage of disabled students.
Evidence: percentage = CONCAT(DIVIDE(MULTIPLY(COUNT(disabled.name), 100), (COUNT(person.name that is not in disabled.name))),'%');
SQL: SELECT CAST(COUNT(T2.name) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name