db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
student_loan
select count(name) from enrolled where school = 'smc' and month = 1
Question: how many students are enrolled in smc during month 1? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joi...
how many students are enrolled in smc during month 1?
student_loan
select count(name) from enlist where organ = 'air_force'
Question: how many students enlist in the air force organization? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | J...
how many students enlist in the air force organization?
student_loan
select organ from enlist where name = 'student168'
Question: what is the organization enlisted by student168? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: d...
what is the organization enlisted by student168?
student_loan
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
Question: how many disabled male students joined an organization? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | J...
how many disabled male students joined an organization?
student_loan
select count(t1.name) from enrolled as t1 inner join disabled as t2 on t2.name = t1.name group by t1.school
Question: please provide a disability breakdown for each school. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Jo...
please provide a disability breakdown for each school.
student_loan
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
Question: please provide a gender breakdown for each organization. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | ...
please provide a gender breakdown for each organization.
student_loan
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
Question: list out student names that enrolled in two schools and two organizations? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name,...
list out student names that enrolled in two schools and two organizations?
student_loan
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
Question: what is the percentage difference between month 0 absence and month 9 absence? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> n...
what is the percentage difference between month 0 absence and month 9 absence?
student_loan
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
Question: which school have the highest student enrollment? how many of those students are filed for bankruptcy? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemploye...
which school have the highest student enrollment? how many of those students are filed for bankruptcy?
student_loan
select count(t1.name) from disabled as t1 inner join unemployed as t2 on t2.name = t1.name
Question: how many students is disabled and unemployed at the same time? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mon...
how many students is disabled and unemployed at the same time?
student_loan
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'
Question: list out students that enrolled in occ school and enlisted in a fire department. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled ->...
list out students that enrolled in occ school and enlisted in a fire department.
student_loan
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
Question: which male students are unemployed, disable and were absent for 5 month? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, s...
which male students are unemployed, disable and were absent for 5 month?
student_loan
select name from enrolled where school in ('occ', 'ulca') and name not in ( select name from male )
Question: list out female students that enrolled in occ school and ulca? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mon...
list out female students that enrolled in occ school and ulca?
student_loan
select t2.school, t1.organ from enlist as t1 inner join enrolled as t2 on t2.name = t1.name where t1.name = 'student211'
Question: what is the school and organization enrolled by student211? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month....
what is the school and organization enrolled by student211?
student_loan
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
Question: how many male students filed for bankruptcy as compare to female students? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name,...
how many male students filed for bankruptcy as compare to female students?
student_loan
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
Question: what is the average absent month for a unemployed male students? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, m...
what is the average absent month for a unemployed male students?
student_loan
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 ...
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? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> ...
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?
student_loan
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
Question: calculate the average duration of absense of disabled male students. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, schoo...
calculate the average duration of absense of disabled male students.
student_loan
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
Question: calculate the ratio of unemployed students who have never been absent from school. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled ...
calculate the ratio of unemployed students who have never been absent from school.
student_loan
select count(t1.name) from no_payment_due as t1 inner join male as t2 on t2.name = t1.name where t1.bool = 'pos'
Question: state the number of male students who do not have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mon...
state the number of male students who do not have payment due.
student_loan
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'
Question: state the number of students who filed for bankruptcy and have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name...
state the number of students who filed for bankruptcy and have payment due.
student_loan
select `bool` from no_payment_due where name = 'student124'
Question: what is the status of payment of student 124? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disa...
what is the status of payment of student 124?
student_loan
select count(t1.name) from no_payment_due as t1 inner join disabled as t2 on t1.name = t2.name where t1.bool = 'neg'
Question: state the number of disabled students who have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month....
state the number of disabled students who have payment due.
student_loan
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
Question: state name of students who have the longest duration of absense from school and do not have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemplo...
state name of students who have the longest duration of absense from school and do not have payment due.
student_loan
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'
Question: state name of students who have been absent for 5 months from school and do not have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> ...
state name of students who have been absent for 5 months from school and do not have payment due.
student_loan
select count(t1.name) from disabled as t1 inner join enlist as t2 on t1.name = t2.name where t2.organ = 'marines'
Question: list out the number of disabled students who enlisted in marines. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, ...
list out the number of disabled students who enlisted in marines.
student_loan
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
Question: list out the number of students who have the longest duration of absense from school and enlisted in the peace corps. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, ...
list out the number of students who have the longest duration of absense from school and enlisted in the peace corps.
student_loan
select count(t1.name) from enlist as t1 inner join filed_for_bankrupcy as t2 on t1.name = t2.name where t1.organ = 'navy'
Question: list out the number of students who filed for bankruptcy and enlisted in navy. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> n...
list out the number of students who filed for bankruptcy and enlisted in navy.
student_loan
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'
Question: give the number of students who enlisted in marines and have payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, ...
give the number of students who enlisted in marines and have payment due.
student_loan
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
Question: calculate the ratio of disabled students who have never been absent from school. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled ->...
calculate the ratio of disabled students who have never been absent from school.
student_loan
select count(name) from enlist where organ = 'air_force'
Question: how many students in the air force? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.name ...
how many students in the air force?
student_loan
select count(name) from longest_absense_from_school where month < 4
Question: how many students have been absent less than 4 months? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Jo...
how many students have been absent less than 4 months?
student_loan
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
Question: count the number of female students who belong to marines organization. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, sc...
count the number of female students who belong to marines organization.
student_loan
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
Question: calculate the average duration of absense of female students. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mont...
calculate the average duration of absense of female students.
student_loan
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
Question: state name of female students who filed for bankruptcy. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | J...
state name of female students who filed for bankruptcy.
student_loan
select bool from no_payment_due where name = 'student299'
Question: mention the status of payment of student 299. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disa...
mention the status of payment of student 299.
student_loan
select count(name) from enlist where organ = 'air_force'
Question: how many students are enlisted to the air force? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: d...
how many students are enlisted to the air force?
student_loan
select count(name) from longest_absense_from_school where month > 1
Question: how many students have absent from school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disable...
how many students have absent from school?
student_loan
select name from enlist where organ = 'fire_department'
Question: provide the names of the students enlisted in the fire department. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school,...
provide the names of the students enlisted in the fire department.
student_loan
select count(t1.name) from no_payment_due as t1 inner join disabled as t2 on t1.name = t2.name where t1.bool = 'pos'
Question: how many disabled students have payment due? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disab...
how many disabled students have payment due?
student_loan
select count(t1.name) from filed_for_bankrupcy as t1 inner join enrolled as t2 on t1.name = t2.name where t2.school = 'occ'
Question: among the students that filed for bankruptcy, how many of them have been enrolled in occ? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. en...
among the students that filed for bankruptcy, how many of them have been enrolled in occ?
student_loan
select count(t1.name) from male as t1 inner join disabled as t2 on t1.name = t2.name
Question: how many disabled students are male? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.name...
how many disabled students are male?
student_loan
select t1.name from enlist as t1 inner join disabled as t2 on t1.name = t2.name where t1.organ = 'navy'
Question: list the names of disabled students enlisted in the navy. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. |...
list the names of disabled students enlisted in the navy.
student_loan
select t1.name from male as t1 inner join no_payment_due as t2 on t1.name = t2.name where t2.bool = 'pos'
Question: among the male students, list down the names of students with payment due. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name,...
among the male students, list down the names of students with payment due.
student_loan
select t1.bool from no_payment_due as t1 inner join unemployed as t2 on t1.name = t2.name where t1.name = 'student110'
Question: what is the employment and payment status of student110? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | ...
what is the employment and payment status of student110?
student_loan
select cast(count(t2.name) as real) * 100 / count(t1.name) from person as t1 left join male as t2 on t1.name = t2.name
Question: among all students, calculate the percentage of male students. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mon...
among all students, calculate the percentage of male students.
student_loan
select t1.school , iif(t3.name is null, 'female', 'male') as gender from enrolled as t1 inner join person as t2 on t1.name = t2.name left join male as t3 on t2.name = t3.name where t2.name = 'student34'
Question: what is the school and gender of student34? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabl...
what is the school and gender of student34?
student_loan
select t1.month from longest_absense_from_school as t1 inner join enlist as t2 on t1.name = t2.name where t2.organ = 'fire_department' order by t1.month desc limit 1
Question: list the longest duration of absense for a student enlisted in the fire department. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled...
list the longest duration of absense for a student enlisted in the fire department.
student_loan
select count(t1.name) from longest_absense_from_school as t1 inner join enlist as t2 on t1.name = t2.name where t1.month = 1 and t2.organ = 'air_force'
Question: among students with 1 month of absenses, how many of them are enlisted in the air force department? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -...
among students with 1 month of absenses, how many of them are enlisted in the air force department?
student_loan
select t2.name from unemployed as t1 inner join male as t2 on t1.name = t2.name inner join disabled as t3 on t3.name = t2.name
Question: provide the name of disabled male students that are unemployed. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, mo...
provide the name of disabled male students that are unemployed.
student_loan
select count(t1.name) from enrolled as t1 inner join male as t2 on t1.name = t2.name where t1.school = 'occ'
Question: how many male students are enrolled at occ? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabl...
how many male students are enrolled at occ?
student_loan
select cast(count(t4.name) as real) * 100 / count(t2.name) from enlist as t1 inner join person as t2 on t1.name = t2.name inner join enrolled as t3 on t3.name = t2.name left join male as t4 on t2.name = t4.name where t3.school = 'ucla' and t1.organ = 'air_force'
Question: among the students enrolled in ucla, what is the percentage of male students in the air force department? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unempl...
among the students enrolled in ucla, what is the percentage of male students in the air force department?
student_loan
select cast(sum(iif(t1.school = 'uci' and t4.name is null, 1, 0)) as real) / count(t1.name) from enrolled as t1 inner join disabled as t2 on t1.name = t2.name inner join person as t3 on t1.name = t3.name left join male as t4 on t3.name = t4.name
Question: calculate the average number of disabled female students enrolled in uci. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, ...
calculate the average number of disabled female students enrolled in uci.
student_loan
select count(name) from longest_absense_from_school where month = 0
Question: how many students have never been absent in school? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins...
how many students have never been absent in school?
student_loan
select name from enlist where organ = 'marines'
Question: what are the names of the students who joined the marines? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. ...
what are the names of the students who joined the marines?
student_loan
select count(name) from enlist where organ = 'navy'
Question: how many students enlisted in the navy? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: disabled.n...
how many students enlisted in the navy?
student_loan
select name from longest_absense_from_school where month = ( select max(month) from longest_absense_from_school )
Question: what is the name of the student with the longest duration of absence? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, scho...
what is the name of the student with the longest duration of absence?
student_loan
select organ from ( select organ, count(organ) as num from enlist group by organ ) t order by t.num desc limit 1
Question: what is the name of the organization which most of the students are enlisted in? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled ->...
what is the name of the organization which most of the students are enlisted in?
student_loan
select count(name) from longest_absense_from_school where month < 3
Question: how many students have absences of no more than 3 months? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. |...
how many students have absences of no more than 3 months?
student_loan
select count(t1.name) from no_payment_due as t1 inner join unemployed as t2 on t1.name = t2.name where t1.bool = 'pos'
Question: among the students that have a payment due, how many students are unemployed? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> na...
among the students that have a payment due, how many students are unemployed?
student_loan
select sum(iif(t3.name is null, 1, 0)) as 'result' from enlist as t1 inner join person as t2 on t1.name = t2.name left join male as t3 on t2.name = t3.name where t1.organ = 'army'
Question: how many female students have enlisted for the army? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Join...
how many female students have enlisted for the army?
student_loan
select t.organ from ( select t2.organ, count(t1.name) as num from male as t1 inner join enlist as t2 on t1.name = t2.name group by t2.organ ) t order by t.num limit 1
Question: which organization has the least number of male students? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. |...
which organization has the least number of male students?
student_loan
select count(t1.name) from disabled as t1 inner join longest_absense_from_school as t2 on t1.name = t2.name where t2.month = 0
Question: how many disabled students have zero absences? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: dis...
how many disabled students have zero absences?
student_loan
select count(t1.name) from unemployed as t1 inner join disabled as t2 on t1.name = t2.name
Question: how many of the unemployed students are disabled? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Joins: ...
how many of the unemployed students are disabled?
student_loan
select t1.name from longest_absense_from_school as t1 inner join disabled as t2 on t1.name = t2.name where t1.month > 5
Question: list the names of the disabled students who were absent from school for more than 5 months. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. ...
list the names of the disabled students who were absent from school for more than 5 months.
student_loan
select count(t1.name) from filed_for_bankrupcy as t1 inner join enlist as t2 on t1.name = t2.name where t2.organ = 'marines'
Question: how many bankrupt students are there in the marines? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | Join...
how many bankrupt students are there in the marines?
student_loan
select count(t1.name) from disabled as t1 inner join filed_for_bankrupcy as t2 on t1.name = t2.name
Question: among the students who filed for bankruptcy, how many students are disabled? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> nam...
among the students who filed for bankruptcy, how many students are disabled?
student_loan
select t1.month from longest_absense_from_school as t1 inner join enlist as t2 on t1.name = t2.name order by t1.month desc limit 1
Question: how many months did a student in the air force miss school the most? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, schoo...
how many months did a student in the air force miss school the most?
student_loan
select count(t1.name) from longest_absense_from_school as t1 inner join filed_for_bankrupcy as t2 on t1.name = t2.name inner join enlist as t3 on t3.name = t2.name where t3.organ = 'fire_department'
Question: among the students who filed for bankruptcy with an absence in school of no more than 6 months, how many students enlisted for the fire department? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> ...
among the students who filed for bankruptcy with an absence in school of no more than 6 months, how many students enlisted for the fire department?
student_loan
select count(t1.name) from longest_absense_from_school as t1 inner join disabled as t2 on t1.name = t2.name inner join unemployed as t3 on t3.name = t2.name where t1.month = 0
Question: how many employed disabled students have zero absences? | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_payment_due -> name, bool. unemployed -> name. enrolled -> name, school, month. | J...
how many employed disabled students have zero absences?
student_loan
select t.organ, t.per from ( select t1.organ, cast(count(t3.name) as real) / count(t2.name) as per , count(t3.name) as num from enlist as t1 inner join person as t2 on t1.name = t2.name left join male as t3 on t2.name = t3.name group by t1.organ ) t order by t.num desc limit 1
Question: which organization has the highest number of male students? calculate for the percentage of the male students in the said organization. | Tables: bool -> name. person -> name. disabled -> name. enlist -> name, organ. filed_for_bankrupcy -> name. longest_absense_from_school -> name, month. male -> name. no_pay...
which organization has the highest number of male students? calculate for the percentage of the male students in the said organization.
mental_health_survey
select count(questionid) from answer where questionid = 19 and answertext like 'no'
Question: how many users answered 'no' to question 19? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users answered 'no' to question 19?
mental_health_survey
select surveyid, count(userid) from answer where questionid = 13 and surveyid between 2016 and 2019 group by surveyid
Question: from 2016 to 2019, how many users each year were asked the question 13? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
from 2016 to 2019, how many users each year were asked the question 13?
mental_health_survey
select t1.userid from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t1.surveyid = 2018 and t2.questionid = 1 and t1.answertext between '27' and '35'
Question: how many users, between the age 27 to 35, were surveyed in 2018? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users, between the age 27 to 35, were surveyed in 2018?
mental_health_survey
select count(t1.userid) from answer as t1 inner join ( select t2.questionid from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t1.surveyid = 2019 and t2.questionid = 6 and t1.answertext like 'yes' ) as t2 on t1.questionid = t2.questionid where t1.surveyid = 2019 and t2.questionid = 3 and...
Question: in 2019, how many users in the united states have a family history of mental illness? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
in 2019, how many users in the united states have a family history of mental illness?
mental_health_survey
select t1.surveyid from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t1.surveyid between 2016 and 2019 and t2.questionid = 34 and t1.answertext like 'yes' group by t1.surveyid order by count(t1.userid) desc limit 1
Question: betweeen 2016 to 2019, which year recorded the highest number of people with mental illness? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
betweeen 2016 to 2019, which year recorded the highest number of people with mental illness?
mental_health_survey
select count(*) from ( select t2.userid from question as t1 inner join answer as t2 on t1.questionid = t2.questionid inner join survey as t3 on t2.surveyid = t3.surveyid where t3.description = 'mental health survey for 2017' and t1.questionid = 2 and t2.answertext = 'female' union select t2.userid from question as t1 i...
Question: how many female users were surveyed in the mental health survey for 2017 in the state of nebraska? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many female users were surveyed in the mental health survey for 2017 in the state of nebraska?
mental_health_survey
select count(t1.userid) from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 54 and t1.answertext like 'yes'
Question: how many users believed that their productivity is ever affected by a mental health issue overall? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users believed that their productivity is ever affected by a mental health issue overall?
mental_health_survey
select max(t1.answertext), min(t1.answertext) , ( select t1.userid from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 1 order by t1.answertext limit 1 ) as 'youngest id' from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 1
Question: what are the ages of the oldest and youngest user that were surveyed? indicate their user id. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what are the ages of the oldest and youngest user that were surveyed? indicate their user id.
mental_health_survey
select t1.answertext from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 3 group by t1.answertext order by count(t1.userid) desc limit 1
Question: which country have the least number of users being surveyed? indicate the name of the country. if there are multiple countries having the same number of users, indicate all of their names. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, ...
which country have the least number of users being surveyed? indicate the name of the country. if there are multiple countries having the same number of users, indicate all of their names.
mental_health_survey
select cast(sum(t1.answertext) as real) / count(t1.userid) from answer as t1 inner join ( select t1.userid from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 3 and t1.answertext = 'united states' ) as t2 on t1.userid = t2.userid inner join question as t3 on t1.questionid ...
Question: what is the average age of the survey respondents in the united states? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what is the average age of the survey respondents in the united states?
mental_health_survey
select cast(sum(case when t1.answertext like 'yes' then 1 else 0 end) as real) * 100 / count(t1.userid) from answer as t1 inner join question as t2 on t1.questionid = t2.questionid where t2.questionid = 12
Question: what is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?
mental_health_survey
select count(questionid) from answer where surveyid like 2014 group by questionid order by count(questionid) > 200 limit 1
Question: how many questions in 2014's survey had more than 200 answers? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many questions in 2014's survey had more than 200 answers?
mental_health_survey
select t2.answertext from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t1.questiontext = 'what is your age?' and t2.surveyid = 2014 order by t2.answertext desc limit 1
Question: what is the oldest age of the users in 2014's survey? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what is the oldest age of the users in 2014's survey?
mental_health_survey
select count(t2.userid) from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t1.questiontext = 'would you bring up a mental health issue with a potential employer in an interview?' and t2.surveyid = 2014 and t2.answertext like 'no'
Question: how many users answered 'no' to the question 'would you bring up a mental health issue with a potential employer in an interview?' in 2014's survey? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users answered 'no' to the question 'would you bring up a mental health issue with a potential employer in an interview?' in 2014's survey?
mental_health_survey
select t2.userid from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t1.questiontext = 'do you think that discussing a physical health issue with your employer would have negative consequences?' and t2.answertext like 'yes' and t2.surveyid = 2014
Question: please list the ids of the users who answered 'yes' to the question 'do you think that discussing a physical health issue with your employer would have negative consequences?' in 2014's survey. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, Use...
please list the ids of the users who answered 'yes' to the question 'do you think that discussing a physical health issue with your employer would have negative consequences?' in 2014's survey.
mental_health_survey
select count(distinct t1.userid) from answer as t1 inner join survey as t2 on t1.surveyid = t2.surveyid where t2.description = 'mental health survey for 2014'
Question: how many users participated in the mental health survey for 2014? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users participated in the mental health survey for 2014?
mental_health_survey
select t2.answertext from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t1.questiontext = 'any additional notes or comments' and t2.surveyid = 2014 and t2.answertext <> -1
Question: please list all the answers to the question 'any additional notes or comments' that are not null in 2014's survey. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
please list all the answers to the question 'any additional notes or comments' that are not null in 2014's survey.
mental_health_survey
select t1.questiontext from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid in (2014, 2016) group by t1.questiontext
Question: please list all the common questions in 2014's survey and 2016's survey. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
please list all the common questions in 2014's survey and 2016's survey.
mental_health_survey
select count(t2.userid) from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid = 2018 and t1.questiontext = 'what country do you live in?' and t2.answertext = 'canada'
Question: how many users lived in canada according to 2018's survey? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users lived in canada according to 2018's survey?
mental_health_survey
select t2.questiontext from answer as t1 inner join question as t2 on t1.questionid = t2.questionid inner join survey as t3 on t1.surveyid = t3.surveyid where t3.description like 'mental health survey for 2014' group by t2.questiontext
Question: please list all the questions in the mental health survey for 2014. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
please list all the questions in the mental health survey for 2014.
mental_health_survey
select count(t2.userid) from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid = 2016 and t1.questiontext like 'have you had a mental health disorder in the past?' and t2.answertext = 'yes'
Question: according to 2016's survey, what is the number of users with a mental health disorder in the past? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
according to 2016's survey, what is the number of users with a mental health disorder in the past?
mental_health_survey
select count(t2.userid) from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid in (2016, 2017, 2018) and t1.questiontext like 'have you had a mental health disorder in the past?' and t2.answertext = 'yes'
Question: how many users answered 'yes' to the question 'have you had a mental health disorder in the past?' in 3 consecutive years starting from 2016? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users answered 'yes' to the question 'have you had a mental health disorder in the past?' in 3 consecutive years starting from 2016?
mental_health_survey
select cast(sum(t2.answertext) as real) / count(t2.userid) as 'avg' from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid = 2014 and t1.questiontext like 'what is your age?'
Question: what is the average result of the question 'what is your age?' in 2014's survey? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what is the average result of the question 'what is your age?' in 2014's survey?
mental_health_survey
select cast(( select count(t2.userid) from question as t1 inner join answer as t2 on t1.questionid = t2.questionid where t2.surveyid = 2019 and t1.questiontext like 'do you currently have a mental health disorder?' and t2.answertext = 'yes' ) - ( select count(t2.userid) from question as t1 inner join answer as t2 on t1...
Question: what is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
what is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey?
mental_health_survey
select questionid from question where questiontext like 'would you bring up a physical health issue with a potential employer in an interview?'
Question: tell the question id for 'would you bring up a physical health issue with a potential employer in an interview?'. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
tell the question id for 'would you bring up a physical health issue with a potential employer in an interview?'.
mental_health_survey
select max(userid) - min(userid) + 1 from answer where questionid = 20
Question: how many users answered the question no.20? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users answered the question no.20?
mental_health_survey
select count(questionid) from answer where userid = 5
Question: how many questions did user no.5 answer? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many questions did user no.5 answer?
mental_health_survey
select count(distinct userid) from answer where surveyid like 2016
Question: how many users participated in the survey no.2016? | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
how many users participated in the survey no.2016?
mental_health_survey
select count(t1.questionid) from answer as t1 inner join survey as t2 on t1.surveyid = t2.surveyid where t2.description = 'mental health survey for 2018'
Question: state the number of questions that were asked in the 'mental health survey for 2018'. | Tables: Question -> questiontext, questionid. Survey -> SurveyID, Description. Answer -> AnswerText, SurveyID, UserID, QuestionID. | Joins:
state the number of questions that were asked in the 'mental health survey for 2018'.