QIAN-ME/bird_schema_data huggingface dataset:
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    How many students have been absent less than 4 months? absent less than 4 months refers to month < 4;

    【Evidence】
    absent less than 4 months refers to month < 4;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month < 4
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    Count the number of female students who belong to marines organization. female students refers to enlist.name who are NOT in male.name; organization refers to organ; organ = 'marines';

    【Evidence】
    female students refers to enlist.name who are NOT in male.name; organization refers to organ; organ = 'marines';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    Calculate the average duration of absense of female students. 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;

    【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;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

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
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    State name of female students who filed for bankruptcy. female students refers to filed_for_bankrupcy.name who are NOT in male.name;

    【Evidence】
    female students refers to filed_for_bankrupcy.name who are NOT in male.name;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT T1.name FROM person AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name LEFT JOIN male AS T3 ON T1.name = T3.name WHERE T3.name IS NULL
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    Mention the status of payment of student 299. 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; student299 is a name of student;

    【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; student299 is a name of student;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT bool FROM no_payment_due WHERE name = 'student299'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    How many students are enlisted to the air force? Air Force refers to organ = 'air_force';

    【Evidence】
    Air Force refers to organ = 'air_force';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'air_force'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    How many students have absent from school? have absent from school refers to month > 1;

    【Evidence】
    have absent from school refers to month > 1;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 1
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    Provide the names of the students enlisted in the fire department. department refers to organ; organ = 'fire_department';

    【Evidence】
    department refers to organ; organ = 'fire_department';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT name FROM enlist WHERE organ = 'fire_department'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    How many disabled students have payment due? payment due refers to bool = 'pos';

    【Evidence】
    payment due refers to bool = 'pos';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    Among the students that filed for bankruptcy, how many of them have been enrolled in OCC? OCC refers to school = 'occ';

    【Evidence】
    OCC refers to school = 'occ';

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN enrolled AS T2 ON T1.name = T2.name WHERE T2.school = 'occ'
You are now a sqlite data analyst, and you are given a database schema as follows:

    【Schema】
    【DB_ID】 student_loan
【Schema】
# Table: unemployed
[
(name:TEXT, Primary Key, Examples: [student1000, student102, student106])
]
# Table: longest_absense_from_school
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(month:INTEGER, Examples: [0, 1, 2])
]
# Table: disabled
[
(name:TEXT, Primary Key, Examples: [student114, student125, student142])
]
# Table: person
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100])
]
# Table: male
[
(name:TEXT, Primary Key, Examples: [student1, student101, student102])
]
# Table: no_payment_due
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(bool:TEXT, Examples: [neg, pos])
]
# Table: enrolled
[
(name:TEXT, Primary Key, Examples: [student1, student10, student100]),
(school:TEXT, Primary Key, Examples: [occ, smc, ucb]),
(month:INTEGER, Examples: [1, 2, 3])
]
# Table: enlist
[
(name:TEXT, Examples: [student40, student51, student109]),
(organ:TEXT, Examples: [fire_department, air_force, navy])
]
# Table: bool
[
(name:TEXT, Primary Key, Examples: [neg, pos])
]
# Table: filed_for_bankrupcy
[
(name:TEXT, Primary Key, Examples: [student122, student126, student136])
]
【Foreign keys】
unemployed.name=person.name
longest_absense_from_school.name=person.name
disabled.name=person.name
male.name=person.name
no_payment_due.name=person.name
no_payment_due.bool=bool.name
enrolled.name=person.name
enlist.name=person.name
filed_for_bankrupcy.name=person.name

    【Question】
    How many disabled students are male? male students are mentioned in male.name;

    【Evidence】
    male students are mentioned in male.name;

    Please read and understand the database schema carefully, and generate an executable SQL based on the user's question and evidence. 

SQL: SELECT COUNT(T1.name) FROM male AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name