Chinastark/bird_dataset huggingface dataset:
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Database: student_loan
Question: Among students who have been absent for nine months, how many of them are disabled?
Evidence: absent for 9 months refers to month = 9;
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 LEFT JOIN longest_absense_from_school AS T2 ON T2.name = T1.name WHERE T2.month = 9
Database: student_loan
Question: List down the student names who did not file for bankruptcy.
Evidence: students name who did not file a bankruptcy refers to person.name who are NOT in filed_for_bankrupcy.name;
SQL: SELECT name FROM person WHERE name NOT IN ( SELECT name FROM filed_for_bankrupcy )
Database: student_loan
Question: List any five female students' names who enlisted for the air force.
Evidence: female students refers to enlist.name who are NOT in male.name; air force refers to organ = 'air_force';
SQL: SELECT T1.name FROM enlist AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T2.name IS NULL AND T1.organ = 'air_force' LIMIT 5
Database: student_loan
Question: Calculate the number of students who are not disabled.
Evidence: students who are not disabled refers to person.name who are NOT in disabled.name;
SQL: SELECT COUNT(CASE  WHEN T2.name IS NULL THEN T1.name END) AS "number" FROM person AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name
Database: student_loan
Question: Define the gender of "student995" and his/her enrolled schools.
Evidence: male.name = 'student995' means student995's gender is male; if 'student995' can not be found in 'male.name', it means student995 is female;
SQL: SELECT IIF(T2.name IS NULL, 'female', 'male') AS gen , T1.school FROM enrolled AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name WHERE T1.name = 'student995'
Database: student_loan
Question: Among the students with disabilities, list any five students' names who are unemployed.
Evidence: students with disabilities who are unemployed refers to disabled.name who are IN unemployed.name;
SQL: SELECT T1.name FROM disabled AS T1 INNER JOIN unemployed AS T2 ON T2.name = T1.name LIMIT 5
Database: student_loan
Question: How many unemployed students filed for bankruptcy?
Evidence: unemployed students who filed for bankruptcy refers to unemployed.name who are IN filed_for_bankrupcy.name;
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T2.name = T1.name
Database: student_loan
Question: Among the students who have been absent for four months, provide any five students' names and enlisted organizations.
Evidence: absent for four months refers to month = 4; enlisted organizations refers to organ;
SQL: SELECT T2.name, T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T2.name = T1.name WHERE T1.month = 4 LIMIT 5
Database: student_loan
Question: Among the students with payment due, how many of them are unemployed?
Evidence: with 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
Question: Provide the enlisted organizations of student160 and status of his/her payment due.
Evidence: enlisted organizations refers to organ; student160 is a name of student; status of his or her payment due is mentioned in no_payment_due; bool = 'pos' means the student has payment due; bool = 'neg' means the student has no payment due;
SQL: SELECT T1.organ, T2.bool FROM enlist AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T1.name = 'student160'
Database: student_loan
Question: List any ten male students who enlisted for foreign legion.
Evidence: male students are mentioned in male.name; foreign legion refers to organ = 'foreign_legion';
SQL: SELECT T1.name FROM enlist AS T1 INNER JOIN male AS T2 ON T2.name = T1.name WHERE T1.organ = 'foreign_legion' LIMIT 10
Database: student_loan
Question: Calculate the percentage of female students.
Evidence: percentage = CONCAT(DIVIDE(MULTIPLY(COUNT(person.name which is not in male.name)), 100), COUNT(person.name that is IN male.name),'%'); female students refers to person.name who are NOT in male.name;
SQL: SELECT CAST(SUM(IIF(T2.name IS NULL, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM person AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name
Database: student_loan
Question: How many students are filed for bankruptcy?
SQL: SELECT COUNT(name) FROM filed_for_bankrupcy
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
Database: student_loan
Question: List out female students that enrolled in occ school and ulca?
Evidence: female students refers to enrolled.name who are NOT in male.name; occ school and ulca refers to school IN('occ', 'ulca');
SQL: SELECT name FROM enrolled WHERE school IN ('occ', 'ulca') AND name NOT IN ( SELECT name FROM male )
Database: student_loan
Question: What is the school and organization enrolled by student211?
Evidence: organization refers to organ; student211 is a name of student;
SQL: SELECT T2.school, T1.organ FROM enlist AS T1 INNER JOIN enrolled AS T2 ON T2.name = T1.name WHERE T1.name = 'student211'
Database: student_loan
Question: How many male students filed for bankruptcy as compare to female students?
Evidence: difference = SUBTRACT(COUNT(filed_for_bankrupcy.name who are In male.name), COUNT(filed_for_bankrupcy.name who are NOT in male.name)); male students are mentioned in male.name; female students refers to filed_for_bankrupy.name who are NOT in male.name;
SQL: SELECT COUNT(T2.name) - SUM(IIF(T2.name IS NULL, 1, 0)) AS num FROM filed_for_bankrupcy AS T1 LEFT JOIN male AS T2 ON T2.name = T1.name
Database: student_loan
Question: What is the average absent month for a unemployed male students?
Evidence: average = DIVIDE(SUM(month), COUNT(unemployed.name who are in male.name)); unemployed male students refers to unemployed.name who are IN male.name;
SQL: SELECT AVG(T2.month) AS avg FROM unemployed AS T1 INNER JOIN longest_absense_from_school AS T2 ON T2.name = T1.name INNER JOIN male AS T3 ON T3.name = T2.name
Database: student_loan
Question: What is the percentage difference between the attendence of disabled and non-disable students? Do the disable students show better attendance than non-disable students?
Evidence: difference = MULTIPLY(DIVIDE(SUBTRACT(COUNT(longest_absense_from_school.name that is in disabled.name), COUNT(longest _absense_from_school.name that is NOT in disabled.name), longest _absense_from_school.name), 100)); IF COUNT(longest_absense_from_school.name that is in disabled.name) < COUNT(longest _absense_from_school.name that is NOT in disabled.name), it means, the disabled students have better attendance than non-disabled students; IF COUNT(longest_absense_from_school.name that is in disabled.name) > COUNT(longest _absense_from_school.name that is NOT in disabled.name), it means the disabled students do not have a better attendance than non-disabled students;
SQL: SELECT CAST((SUM(IIF(T2.name IS NOT NULL AND T1.month = 0, 1, 0)) - SUM(IIF(T2.name IS NULL AND T1.month = 0, 1, 0))) AS REAL) * 100 / COUNT(T1.name), IIF(SUM(IIF(T2.name IS NOT NULL AND T1.month = 0, 1, 0)) - SUM(IIF(T2.name IS NULL AND T1.month = 0, 1, 0)) > 0, 'YES', 'NO') AS isHigh FROM longest_absense_from_school AS T1 LEFT JOIN disabled AS T2 ON T2.name = T1.name
Database: student_loan
Question: Calculate the average duration of absense of disabled male students.
Evidence: average duration = DIVIDE(SUM(month), COUNT(month)); duration of absence refers to month; disabled male students refers to disabled.name who are IN male.name;
SQL: SELECT AVG(T1.month) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T2.name = T1.name INNER JOIN male AS T3 ON T3.name = T2.name
Database: student_loan
Question: Calculate the ratio of unemployed students who have never been absent from school.
Evidence: ratio = CONCAT(DIVIDE(MULTIPLY(COUNT(unemployed.name WHERE month = 0), 100), COUNT(month)),'%'); unemployed students who have never been absent from school refers to (unemployed.name WHERE month = 0);
SQL: SELECT CAST(SUM(IIF(T2.month = 0, 1, 0)) AS REAL) * 100 / COUNT(T1.name) FROM unemployed AS T1 INNER JOIN longest_absense_from_school AS T2 ON T2.name = T1.name
Database: student_loan
Question: State the number of male students who do not have payment due.
Evidence: do not have payment due refers to bool = 'neg';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN male AS T2 ON T2.name = T1.name WHERE T1.bool = 'pos'
Database: student_loan
Question: State the number of students who filed for bankruptcy and have payment due.
Evidence: have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN no_payment_due AS T2 ON T2.name = T1.name WHERE T2.bool = 'pos'
Database: student_loan
Question: What is the status of payment of student 124?
Evidence: status of payment is mentioned in no_payment_due; bool = 'pos' means the student has payment due; bool = 'neg' means the student has no payment due; student124 is a name of student;
SQL: SELECT `bool` FROM no_payment_due WHERE name = 'student124'
Database: student_loan
Question: State the number of disabled students who have payment due.
Evidence: have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'neg'
Database: student_loan
Question: State name of students who have the longest duration of absense from school and do not have payment due.
Evidence: longest duration of absence from school refers to MAX(month); do not have payment due refers to bool = 'neg';
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'neg' ORDER BY T1.month DESC LIMIT 1
Database: student_loan
Question: State name of students who have been absent for 5 months from school and do not have payment due.
Evidence: absent for 5 months refers to month = 5; do not have payment due refers to bool = 'neg';
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T1.month = 5 AND T2.bool = 'neg'
Database: student_loan
Question: List out the number of disabled students who enlisted in marines.
Evidence: marines refers to organ = 'marines';
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'
Database: student_loan
Question: List out the number of students who have the longest duration of absense from school and enlisted in the peace corps.
Evidence: longest duration of absence refers to MAX(month); peace corps refers to organ = 'peace_corps';
SQL: SELECT COUNT(T1.NAME) FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'peace_corps' ORDER BY T1.month DESC LIMIT 1
Database: student_loan
Question: List out the number of students who filed for bankruptcy and enlisted in navy.
Evidence: navy refers to organ = 'navy';
SQL: SELECT COUNT(T1.name) FROM enlist AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name WHERE T1.organ = 'navy'
Database: student_loan
Question: Give the number of students who enlisted in marines and have payment due.
Evidence: marines refers to organ = 'marines'; have payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos' AND T2.organ = 'marines'
Database: student_loan
Question: Calculate the ratio of disabled students who have never been absent from school.
Evidence: ratio = MULTIPLY(DIVIDE(SUM(month = 0), COUNT(disabled.name)), 100); never been absent from school refers to month = 0;
SQL: SELECT 100 * SUM(IIF(T2.month = 0, 1, 0)) AS num FROM disabled AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name
Database: student_loan
Question: How many students in the Air Force?
Evidence: Air Force refers to organ = 'air_force';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'air_force'
Database: student_loan
Question: How many students have been absent less than 4 months?
Evidence: absent less than 4 months refers to month < 4;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month < 4
Database: student_loan
Question: Count the number of female students who belong to marines organization.
Evidence: female students refers to enlist.name who are NOT in male.name; organization refers to organ; organ = 'marines';
SQL: SELECT COUNT(*) FROM person AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T2.organ = 'marines' AND T3.name IS NULL
Database: student_loan
Question: Calculate the average duration of absense of female students.
Evidence: average duration = DIVIDE(SUM(month), COUNT(longest_absence_from_school.name which are NOT in male.name)); female students refers to longest_absence_from_school.name who are NOT in male.name;
SQL: SELECT AVG(T2.month) FROM person AS T1 INNER JOIN longest_absense_from_school AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T3.name IS NULL