1sf/bird-sql-train-with-schema huggingface dataset:
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: List the movie titles and character names by Bill Thompson.
Evidence: Bill Thompson refers to voice-actor = 'Bill Thompson';
SQL: SELECT movie, character FROM `voice-actors` WHERE 'voice-actor' = 'Bill Thompson'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: List the movie titles and associated songs directed by Ron Clements.
Evidence: Ron Clements refers director = 'Ron Clements';
SQL: SELECT T1.movie_title, T1.song FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Ron Clements'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Provide the titles, main characters, and associated songs of the movies directed by Wolfgang Reitherman in 1977.
Evidence: Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; 1997 refers to substr(release_date, length(release_date) - 3, length(release_date)) = '1977'; the titles refer to movie_title; main characters refer to hero;
SQL: SELECT T1.movie_title, T2.hero, T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T1.movie_title = T3.name WHERE T3.director = 'Wolfgang Reitherman' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) = '1977'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Which movies had the main character named Donald Duck and who directed them?
Evidence: Donald Duck is the main character of the movie which refers to hero = 'Donald Duck'; movies refer to movie_title; who directed refers director;
SQL: SELECT T1.movie_title, T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.hero = 'Donald Duck'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Describe the hero, director, and the release date of Mulan.
Evidence: Mulan refers to movie_title = 'Mulan';
SQL: SELECT T1.hero, T2.director, T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.movie_title = 'Mulan'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Provide the title, total gross, and MPAA rating of the movie which has a hero named Elsa.
Evidence: Elsa is the main character of the movie which refers to hero = 'Elsa'; title refers to movie_title;
SQL: SELECT T1.movie_title, T1.total_gross, T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title INNER JOIN director AS T3 ON T3.name = T1.movie_title WHERE T2.hero = 'Elsa'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Provide the title, director, and release date of the movie voice-acted by Freddie Jones.
Evidence: Freddie Jones refers to voice-actor = 'Freddie Jones'; title refers to movie_title;
SQL: SELECT T1.movie, T3.director, T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title INNER JOIN director AS T3 ON T3.name = T2.movie_title WHERE T1.`voice-actor` = 'Freddie Jones'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Among Frank Welker's voice-acted movies, list the movie titles and the total gross when the estimated inflation rate was less than 2.
Evidence: Frank Welker refers to voice-actor = 'Frank Welker'; estimated inflation rate was less than 2 can be computed as follows DIVIDE(inflation_adjusted_gross, total_gross) as percentage < 2;
SQL: SELECT T1.movie_title, T1.total_gross FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Frank Welker' AND CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) * 1.0 / CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) * 1.0 < 2
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Who directed the most popular movie?
Evidence: The most popular movie refers MAX(total_gross); who directed refers to director;
SQL: SELECT T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Describe the voice actors and villains in Cinderella.
Evidence: Cinderella refers to movie_title = ' Cinderella';
SQL: SELECT T1.`voice-actor`, T2.villian FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Cinderella'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Who is the voice actor of the hero in Lion King?
Evidence: Lion King refers to movie_title = 'Lion King';
SQL: SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Lion King' AND T1.character = 'Lion King'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Provide the directors and MPAA ratings of the musical movies released in 1993.
Evidence: Musical movies refer to genre = 'Musical'; released in 1993 refers to substr(release_date, length(release_date) - 3, length(release_date)) = '1993';
SQL: SELECT T2.director, T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.genre = 'Musical' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) = '1993'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Among the movies released from 1991 to 2000, calculate the percentage of comedy movies. Provide any five movie titles and directors.
Evidence: DIVIDE(COUNT(movie_title where genre = 'Comedy'), COUNT(movie_title)) as percentage where substr(release_date, length(release_date) - 3, length(release_date)) between '1991' and '2000';
SQL: SELECT CAST(COUNT(CASE WHEN T1.genre = 'Comedy' THEN T1.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_title), group_concat(T1.movie_title), group_concat(T2.director) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) BETWEEN '1991' AND '2000'
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Among the movies released from 2001 to 2005, list down the titles and directors of the movies which had a total gross of more than 100% above the average.
Evidence: Released from 2001 to 2005 refers to substr(release_date, length(release_date) - 3, length(release_date)) between '2001' and '2005'; DIVIDE(SUM(total_gross), COUNT(movie_title));
SQL: SELECT T2.name, T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) BETWEEN '2001' AND '2005' AND CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) / ( SELECT SUM(CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL)) / COUNT(T3.movie_title) AS avg_gross FROM movies_total_gross AS T3 INNER JOIN director AS T4 ON T3.movie_title = T4.name WHERE SUBSTR(T3.release_date, LENGTH(T3.release_date) - 3, LENGTH(T3.release_date)) BETWEEN '2001' AND '2005' ) - 1 > 1
Database: disney
Tables: characters, director, movies_total_gross, revenue, voice-actors
Columns (table index, column name): -1, *, 0, movie_title, 0, release_date, 0, hero, 0, villian, 0, song, 1, name, 1, director, 2, movie_title, 2, release_date, 2, genre, 2, MPAA_rating, 2, total_gross, 2, inflation_adjusted_gross, 3, Year, 3, Studio Entertainment[NI 1], 3, Disney Consumer Products[NI 2], 3, Disney Interactive[NI 3][Rev 1], 3, Walt Disney Parks and Resorts, 3, Disney Media Networks, 3, Total, 4, character, 4, voice-actor, 4, movie
Question: Name the voice actor of the character Calliope in the movie Hercules.
Evidence: Hercules refers to movie = 'Hercules';
SQL: SELECT `voice-actor` FROM `voice-actors` WHERE movie = 'Hercules' AND character = 'Calliope'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: Tell the number of surveys that contained the question “What country do you work in?”.
Evidence: question refers to questiontext
SQL: SELECT COUNT(DISTINCT T1.QuestionID) 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 T2.questiontext = 'What country do you work in?'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: What answer did user No. 2681 give to the question "Do you currently have a mental health disorder?"?
Evidence: question refers to questiontext; user No. 2681 refers to UserID = 2681


SQL: SELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext = 'Do you currently have a mental health disorder?' AND T1.UserID = 2681
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: Provide the number of users who took part in the "mental health survey for 2016".
Evidence: mental health survey for 2016 refers to SurveyID = 2016
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 2016'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: What was the most common answer for the question "What country do you work in?"?
Evidence: most common answer refers to AnswerText where MAX(COUNT(AnswerText(QuestionID = 3)))
SQL: SELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext = 'What country do you work in?' GROUP BY T1.AnswerText ORDER BY COUNT(T1.AnswerText) DESC LIMIT 1
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: How many different answers did the question "Describe the conversation you had with your previous employer about your mental health, including their reactions and actions taken to address your mental health issue/questions." get?
SQL: SELECT COUNT(DISTINCT T1.AnswerText) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Describe the conversation you had with your previous employer about your mental health, including their reactions and actions taken to address your mental health issue/questions.'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: For the question “What US state or territory do you work in?”, how many people gave "Kansas" as the answer?
Evidence: question refers to questiontext; AnswerText = 'Kansas'
SQL: SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'What US state or territory do you work in?' AND T1.AnswerText = 'Kansas'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: How many people wrote comments for the question "Any additional notes or comments."?
Evidence: question refers to questiontext; wrote comments refers to AnswerText(QuestionID = 103) ! = -1
SQL: SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Any additional notes or comments' AND T1.AnswerText IS NOT NULL
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: For all the users who have been asked "Have you ever been diagnosed with a mental health disorder?", how many of them said "Yes"?
Evidence: have asked refers to questiontext; said 'Yes' refers to AnswerText = 'Yes'
SQL: SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Have you ever been diagnosed with a mental health disorder?' AND T1.AnswerText = 'Yes'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: Give the number of users who took the "mental health survey for 2018".
Evidence: mental health survey for 2018 refers to SurveyID = 2018
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 2018'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: How many users answered the question "Overall, how much importance does your employer place on physical health?"?
Evidence: question refers to questiontext
SQL: SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Overall, how much importance does your employer place on physical health?'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: For which question did the user No.2183 gave the answer "Mood Disorder (Depression, Bipolar Disorder, etc)"?
Evidence: question refers to questiontext; user No.2183 refers to userID = 2183
SQL: SELECT T1.AnswerText FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questionid = 2183 AND T1.AnswerText = 'Mood Disorder (Depression, Bipolar Disorder, etc)'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: What was the percentage for the answer of "Yes" was given to the question "Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?"?
Evidence: percentage = divide(count(QuestionID = 15& AnswerText = 'Yes'), count(QuestionID = 15))*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.questiontext LIKE 'Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: How many times more for the number of users who took the "mental health survey for 2017" than "mental health survey for 2018"?
Evidence: How many times more = subtract(count(UserID(SurveyID = 2017)), count(UserID(SurveyID = 2018)))
SQL: SELECT CAST(COUNT(T1.UserID) AS REAL) / ( SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018' ) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2017'
Database: mental_health_survey
Tables: Question, Survey, Answer
Columns (table index, column name): -1, *, 0, questiontext, 0, questionid, 1, SurveyID, 1, Description, 2, AnswerText, 2, SurveyID, 2, UserID, 2, QuestionID
Question: Among respondents who participated in the survey in 2016, what percentage had a mental health disorder in the past?
Evidence: respondents and 'users' are synonyms; percentage = divide(count(SurveyID = 2016& QuestionID = 32 & AnswerText = 'Yes'), count(SurveyID = 2016& QuestionID = 32))*100%
SQL: SELECT CAST(SUM(CASE  WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.SurveyID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 32 AND T1.SurveyID = 2016