Chinastark/bird_dataset huggingface dataset:
Database: student_loan
Question: State name of female students who filed for bankruptcy.
Evidence: female students refers to filed_for_bankrupcy.name who are NOT in male.name;
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
Database: student_loan
Question: Mention the status of payment of student 299.
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;
SQL: SELECT bool FROM no_payment_due WHERE name = 'student299'
Database: student_loan
Question: How many students are enlisted to the air force?
Evidence: Air Force refers to organ = 'air_force';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'air_force'
Database: student_loan
Question: How many students have absent from school?
Evidence: have absent from school refers to month > 1;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month > 1
Database: student_loan
Question: Provide the names of the students enlisted in the fire department.
Evidence: department refers to organ; organ = 'fire_department';
SQL: SELECT name FROM enlist WHERE organ = 'fire_department'
Database: student_loan
Question: How many disabled students have payment due?
Evidence: payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'
Database: student_loan
Question: Among the students that filed for bankruptcy, how many of them have been enrolled in OCC?
Evidence: OCC refers to school = 'occ';
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'
Database: student_loan
Question: How many disabled students are male?
Evidence: male students are mentioned in male.name;
SQL: SELECT COUNT(T1.name) FROM male AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name
Database: student_loan
Question: List the names of disabled students enlisted in the navy.
Evidence: navy refers to organ = 'navy';
SQL: SELECT T1.name FROM enlist AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.organ = 'navy'
Database: student_loan
Question: Among the male students, list down the names of students with payment due.
Evidence: male students are mentioned in male.name; with payment due refers to bool = 'pos';
SQL: SELECT T1.name FROM male AS T1 INNER JOIN no_payment_due AS T2 ON T1.name = T2.name WHERE T2.bool = 'pos'
Database: student_loan
Question: What is the employment and payment status of student110?
Evidence: employment status is mentioned in unemployment; unemployed.name = 'student110' means the student is unemployed; if 'student110' can not be found in unemployed.name, it means the student is employed; payment status is mentioned in no_payment_due; bool = 'pos' means the student has payment due; bool = 'neg' means the student has no payment due; student110 is a name of student;
SQL: SELECT T1.bool FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.name = 'student110'
Database: student_loan
Question: Among all students, calculate the percentage of male students.
Evidence: percentage = MULTIPLY(DIVIDE(COUNT(male.name), COUNT(person.name)), 100); male students are mentioned in male.name;
SQL: 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
Database: student_loan
Question: What is the school and gender of student34?
Evidence: male.name = 'student34' means student34's gender is male; if 'student34' can't be found in 'male.name', it means student34 is female; student34 is a name of student;
SQL: 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'
Database: student_loan
Question: List the longest duration of absense for a student enlisted in the fire department.
Evidence: longest duration of absence refers to MAX(month); department refers to organ; organ = 'fire_department';
SQL: 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
Database: student_loan
Question: Among students with 1 month of absenses, how many of them are enlisted in the air force department?
Evidence: 1 month of absences refers to month = 1; department refers to organ; organ = 'air_force';
SQL: 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'
Database: student_loan
Question: Provide the name of disabled male students that are unemployed.
Evidence: disabled male students that are unemployed refers to unemployed.name = male.name = disabled.name;
SQL: 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
Database: student_loan
Question: How many male students are enrolled at OCC?
Evidence: male students are mentioned in male.name; OCC refers to school = 'occ';
SQL: SELECT COUNT(T1.name) FROM enrolled AS T1 INNER JOIN male AS T2 ON T1.name = T2.name WHERE T1.school = 'occ'
Database: student_loan
Question: Among the students enrolled in UCLA, what is the percentage of male students in the air force department?
Evidence: UCLA refers to school = 'ucla'; percentage = MULTIPLY(DIVIDE(COUNT(male.name), COUNT(person.name)), 100); male students are mentioned in male.name; department refers to organ; organ = 'air_force';
SQL: 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'
Database: student_loan
Question: Calculate the average number of disabled female students enrolled in UCI.
Evidence: average = DIVIDE(SUM(disabled.name who are not in male.name WHERE school = 'uci'), COUNT(enrolled.name)); female students refers to disabled.name who are NOT in male.name; UCI refers to school = 'uci';
SQL: 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
Database: student_loan
Question: How many students have never been absent in school?
Evidence: never been absent in school refers to month = 0;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month = 0
Database: student_loan
Question: What are the names of the students who joined the Marines?
Evidence: Marines refers to organ = 'marines';
SQL: SELECT name FROM enlist WHERE organ = 'marines'
Database: student_loan
Question: How many students enlisted in the Navy?
Evidence: Navy refers to organ = 'navy';
SQL: SELECT COUNT(name) FROM enlist WHERE organ = 'navy'
Database: student_loan
Question: What is the name of the student with the longest duration of absence?
Evidence: longest duration of absence refers to MAX(month);
SQL: SELECT name FROM longest_absense_from_school WHERE month = ( SELECT MAX(month) FROM longest_absense_from_school )
Database: student_loan
Question: What is the name of the organization which most of the students are enlisted in?
Evidence: name of the organization refers to organ; organization which most of the students are enlisted in refers to MAX(COUNT(organ));
SQL: SELECT organ FROM ( SELECT organ, COUNT(organ) AS num FROM enlist GROUP BY organ ) T ORDER BY T.num DESC LIMIT 1
Database: student_loan
Question: How many students have absences of no more than 3 months?
Evidence: absences of no more than 3 months refers to month < 3;
SQL: SELECT COUNT(name) FROM longest_absense_from_school WHERE month < 3
Database: student_loan
Question: Among the students that have a payment due, how many students are unemployed?
Evidence: students that have a payment due refers to bool = 'pos';
SQL: SELECT COUNT(T1.name) FROM no_payment_due AS T1 INNER JOIN unemployed AS T2 ON T1.name = T2.name WHERE T1.bool = 'pos'
Database: student_loan
Question: How many female students have enlisted for the Army?
Evidence: female students refers to enlist.name who are NOT in male.name; Army refers to organ = 'army';
SQL: 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'
Database: student_loan
Question: Which organization has the least number of male students?
Evidence: organization refers to organ; male students are mentioned in male.name; least number of male students refers to MIN(male.name);
SQL: 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
Database: student_loan
Question: How many disabled students have zero absences?
Evidence: zero absences refers to month = 0;
SQL: 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
Database: student_loan
Question: How many of the unemployed students are disabled?
SQL: SELECT COUNT(T1.name) FROM unemployed AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name
Database: student_loan
Question: List the names of the disabled students who were absent from school for more than 5 months.
Evidence: absent for more than 5 months refers to month > 5;
SQL: SELECT T1.name FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name WHERE T1.month > 5
Database: student_loan
Question: How many bankrupt students are there in the Marines?
Evidence: Marines refers to organ = 'marines';
SQL: SELECT COUNT(T1.name) FROM filed_for_bankrupcy AS T1 INNER JOIN enlist AS T2 ON T1.name = T2.name WHERE T2.organ = 'marines'
Database: student_loan
Question: Among the students who filed for bankruptcy, how many students are disabled?
SQL: SELECT COUNT(T1.name) FROM disabled AS T1 INNER JOIN filed_for_bankrupcy AS T2 ON T1.name = T2.name
Database: student_loan
Question: How many months did a student in the Air Force miss school the most?
Evidence: Air Force refers to organ = 'air_force'; number of months a student miss school the most refers to MAX(COUNT(month));
SQL: 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
Database: student_loan
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?
Evidence: absence of no more than 6 months refers to month < 6; department refers to organ; organ = 'fire_department';
SQL: 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'
Database: student_loan
Question: How many employed disabled students have zero absences?
Evidence: employed students refers to disabled.name who are NOT in unemployed.name; zero absences refers to month = 0;
SQL: SELECT COUNT(T1.name) FROM longest_absense_from_school AS T1 INNER JOIN disabled AS T2 ON T1.name = T2.name INNER JOIN unemployed AS T3 ON T3.name = T2.name WHERE T1.month = 0
Database: student_loan
Question: Which organization has the highest number of male students? Calculate for the percentage of the male students in the said organization.
Evidence: organization refers to organ; highest number of male students refers to MAX(COUNT(male.name)); percentage = DIVIDE(COUNT(male.name), COUNT(person.name)), 1.0;
SQL: 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
Database: mental_health_survey
Question: How many users answered "No" to question 19?
Evidence: Question 19 refer to QuestionID = 19; No refer to AnswerText = 'No'

SQL: SELECT COUNT(QuestionID) FROM Answer WHERE QuestionID = 19 AND AnswerText LIKE 'No'
Database: mental_health_survey
Question: From 2016 to 2019, how many users each year were asked the question 13?
Evidence: From 2016 to 2019 refer to SurveyID 2016 BETWEEN 2019; Question 13 refer to QuestionID
SQL: SELECT SurveyID, COUNT(UserID) FROM Answer WHERE QuestionID = 13 AND SurveyID BETWEEN 2016 AND 2019 GROUP BY SurveyID
Database: mental_health_survey
Question: How many users, between the age 27 to 35, were surveyed in 2018?
Evidence: Age 27 to 35 refer to AnswerText 27 BETWEEN 35 where questionid = 1; 2018 refer to SurveyID


SQL: 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'
Database: mental_health_survey
Question: In 2019, how many users in the United States have a family history of mental illness?
Evidence: 2019 refer to SurveyID; Users in the United States refers to AnswerText = 'United States' where questionid = 3; have a family history of mental illness refers to AnswerText = 'Yes' where questionid = 6
SQL: 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 T1.AnswerText LIKE 'United States'
Database: mental_health_survey
Question: Betweeen 2016 to 2019, which year recorded the highest number of people with mental illness?
Evidence: Between 2016 to 2019 refer to SurveyID 2016 BETWEEN 2019; People with mental illness refers to AnswerText = 'Yes' where questionid = 34
SQL: 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
Database: mental_health_survey
Question: How many female users were surveyed in the mental health survey for 2017 in the state of Nebraska?
Evidence: AnswerText = 'Yes' where questiontext = 'Do you have a family history of mental illness?'; AnswerText = 'Female' where questionid = 2; AnswerText = 'Nebraska' where questionid = 4
SQL: 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 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID INNER JOIN Survey AS T3 ON T2.SurveyID = T3.SurveyID WHERE T1.questionid = 4 AND T2.AnswerText = 'Nebraska' AND T3.Description = 'mental health survey for 2017' )
Database: mental_health_survey
Question: How many users believed that their productivity is ever affected by a mental health issue overall?
Evidence: Users who believed that their productivity is affected by a mental health issues overall refers to AnswerText = 'Yes' where questionid = 54
SQL: 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'
Database: mental_health_survey
Question: What are the ages of the oldest and youngest user that were surveyed? Indicate their user id.
Evidence: Oldest user refer to MAX(AnswerText) where questionid = 1; Youngest user refer to MIN(AnswerText) where questionid = 1

SQL: 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
Database: mental_health_survey
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.
Evidence: Country with least number of users being surveyed refers to MIN(COUNT(AnswerText)) where questionid = 3
SQL: 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
Database: mental_health_survey
Question: What is the average age of the survey respondents in the United States?
Evidence: Average age refer to AVG(AnswerText) where questionid = 1; respondents in the United States refers to AnswerText = 'United States' where questionid = 3
SQL: 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 = T3.questionid WHERE T3.questionid = 1
Database: mental_health_survey
Question: What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?
Evidence: Percentage = DIVIDE(SUM(AnswerText = 'Yes' Or AnswerText = 'Maybe'), COUNT(QuestionID = 12))* 100
SQL: 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
Database: mental_health_survey
Question: How many questions in 2014's survey had more than 200 answers?
Evidence: 2014 refer to SurveyID; COUNT(QuestionID) where COUNT(AnswerText) > 200
SQL: SELECT COUNT(QuestionID) FROM Answer WHERE SurveyID LIKE 2014 GROUP BY QuestionID ORDER BY COUNT(QuestionID) > 200 LIMIT 1
Database: mental_health_survey
Question: What is the oldest age of the users in 2014's survey?
Evidence: what is your age? refer to QuestionText; 2014 refer to SurveyID; oldest age refers to MAX(AnswerText)


SQL: 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
Database: mental_health_survey
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?
Evidence: 2014 refer to SurveyID; Answered No refer to AnswerText = 'No'; Question refer to questiontext


SQL: 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'
Database: mental_health_survey
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.
Evidence: 2014 refer to SurveyID; Question refer to questiontext; yes refer to AnswerText = 'Yes'


SQL: 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
Database: mental_health_survey
Question: How many users participated in the mental health survey for 2014?
Evidence: mental health survey for 2014 refers to SurveyID = 2014
SQL: 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'
Database: mental_health_survey
Question: Please list all the answers to the question "Any additional notes or comments" that are not null in 2014's survey.
Evidence: question refers to questiontext; the answers that are not null refers to AnswerText ! = -1

SQL: 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
Database: mental_health_survey
Question: Please list all the common questions in 2014's survey and 2016's survey.
Evidence: question refers to questiontext; all the common questions in 2014's survey and 2016's survey refers to QuestionID(SurveyID(2014)) = QuestionID(SurveyID(2016))

SQL: 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
Database: mental_health_survey
Question: How many users lived in Canada according to 2018's survey?
Evidence: lived in Canada refers to AnswerText(QuestionID(3)) = 'Canada'
SQL: 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'
Database: mental_health_survey
Question: Please list all the questions in the mental health survey for 2014.
Evidence: mental health survey for 2014 refers to SurveyID = 2014
SQL: 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
Database: mental_health_survey
Question: According to 2016's survey, what is the number of users with a mental health disorder in the past?
Evidence: users with a mental health disorder in the past refers to AnswerText(QuestionID(32)) = 'Yes'
SQL: 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'
Database: mental_health_survey
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?
Evidence: question refers to questiontext; answered 'Yes' to question refers to AnswerText = 'Yes'; 3 consecutive years starting from 2016 refers to SurveyID = 2016 and SurveyID = 2017 and SurveyID = 2018
SQL: 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'
Database: mental_health_survey
Question: What is the average result of the question "What is your age?" in 2014's survey?
Evidence: average result refers to avg(AnswerText(SurveyID = 2014& QuestionID = 1))
SQL: 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?'