Chinastark/bird_dataset huggingface dataset:
Database: student_loan
Question: How many students are unemployed and have payment due?
Evidence: are unemployed and have payment due refers to
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN no_payment_due AS T2 ON T1.`name` = T2.`name`
Database: student_loan
Question: What is the longest time for a student from the navy department to be absent from school?
Evidence: navy department refers to organ = 'navy'; longest time to be absent from school refers to MAX(month)
SQL: SELECT T1.month FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T2.organ = 'navy' ORDER BY T1.`month` DESC LIMIT 1
Database: student_loan
Question: How many disabled students have never been absent from school?
Evidence: never been absent from school refers to month = 0
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 0
Database: student_loan
Question: Please list the departments the students are absent from school for 9 months are in.
Evidence: absent from school for 9 months refers to month = 9
SQL: SELECT T2.organ FROM longest_absense_from_school AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` WHERE T1.`month` = 9
Database: student_loan
Question: Which department has the most disabled students?
Evidence: department refers to organ; most disabled students refers to MAX(disabled.name)
SQL: SELECT T2.organ, COUNT(T1.name) FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name` GROUP BY T2.organ ORDER BY COUNT(T1.name) DESC LIMIT 1
Database: student_loan
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
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
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
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
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
Question: How many months has student217 been absent?
SQL: SELECT month FROM longest_absense_from_school WHERE name = 'student217'
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Question: What is the total number of students in the school?
SQL: SELECT COUNT(name) FROM person
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Database: student_loan
Question: Which organization does student 313 belong to?
Evidence: organization refers to organ
SQL: SELECT organ FROM enlist WHERE name = 'studenT113'
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Question: How many students are disabled?
SQL: SELECT COUNT(name) FROM disabled
Database: student_loan
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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