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】
    What is the total number of students in the school?

    【Evidence】
    

    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 person
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】
    What is the longest students absence duration from school? longest students absence duration MAX(month)

    【Evidence】
    longest students absence duration MAX(month)

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

SQL: SELECT name, month FROM longest_absense_from_school WHERE `month` = ( SELECT MAX(month) FROM longest_absense_from_school )
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 were absence for 4 month? absence for 4 month refers to month = 4;

    【Evidence】
    absence for 4 month 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】
    What is the number of unemployed and bankrupt students?

    【Evidence】
    

    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 unemployed AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name
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】
    Does disable students join organization. If yes, please indicate the organization joined by the students. organization refers to organ

    【Evidence】
    organization refers to organ

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

SQL: SELECT DISTINCT T2.organ FROM disabled AS T1 INNER JOIN enlist AS T2 ON T1.`name` = T2.`name`
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 unemployed and bankrupt students that have payment dues? have payment dues refers to bool = 'pos'

    【Evidence】
    have payment dues 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 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'
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】
    Please check if student 124 is disabled male. 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

    【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

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

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'
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】
    What is the employment, disability, gender and school debt status for student180 and student117? 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;

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

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

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'))
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 female students joined a marines and air force organization? joined a marines refers to organ = 'marines'; air force organization refers to organ = 'air_force';

    【Evidence】
    joined a marines refers to organ = 'marines'; air force organization 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 IN ('marines', 'air_force') AND name NOT IN ( SELECT name FROM male )
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】
    List out the organization joined and school enrolled by student27, student17 and student101? organization joined refers to organ

    【Evidence】
    organization joined refers to organ

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

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')
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】
    What is the ratio of disable female to male students? ratio refers to DIVIDE(COUNT(name not from male), COUNT(name from male))

    【Evidence】
    ratio refers to DIVIDE(COUNT(name not from male), COUNT(name from male))

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

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`