1sf/bird-sql-train-with-schema huggingface dataset:
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: 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
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: 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
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 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
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 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
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 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
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: 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
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 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
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 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
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 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
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 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
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 "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
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: 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
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 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
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: 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
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: 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
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 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
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: 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
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: 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
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 "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
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 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?'
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 is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey?
Evidence: rate of increase = subtract(divide(count(SurveyID = 2019& QuestionID = 33& AnswerText = 'Yes'), count(SurveyID = 2019& QuestionID = 33)), divide(count(SurveyID = 2016& QuestionID = 33& AnswerText = 'Yes'), count(SurveyID = 2016& QuestionID = 33)))
SQL: 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.questionid = T2.QuestionID WHERE T2.SurveyID = 2016 AND T1.questiontext LIKE 'Do you currently have a mental health disorder?' AND T2.AnswerText = 'Yes' ) AS REAL) * 100 / ( 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 'Do you currently have a mental health disorder?' AND T2.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: Tell the question ID for "Would you bring up a physical health issue with a potential employer in an interview?".
SQL: SELECT questionid FROM Question WHERE questiontext LIKE 'Would you bring up a physical health issue with a potential employer in an interview?'
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 No.20?
Evidence: question No.20 refers to QuestionID = 20
SQL: SELECT MAX(UserID) - MIN(UserID) + 1 FROM Answer WHERE QuestionID = 20
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 questions did user No.5 answer?
Evidence: user No.5 refers to userID = 5
SQL: SELECT COUNT(QuestionID) FROM Answer WHERE UserID = 5
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 participated in the Survey No.2016?
Evidence: Survey No.2016 refers to SurveyID = 2016
SQL: SELECT COUNT(DISTINCT UserID) FROM Answer WHERE SurveyID LIKE 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: State the number of questions that were asked in the "mental health survey for 2018".
Evidence: mental health survey for 2018 refers to SurveyID = 2018
SQL: 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'
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 most productive director?
Evidence: Most productive director refers to director where MAX(COUNT(name));
SQL: SELECT director FROM director GROUP BY director ORDER BY COUNT(name) 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: How many restricted horror movies were released between 1/1/1990 to 12/31/2015?
Evidence: Restricted refers to MPAA_rating = 'R'; horror refers to genre = 'Horror'; released between 1/1/1990 to 12/31/2015 refers to (cast(SUBSTR(release_date, instr(release_date, ', ') + 1) as int) between 1990 and 2015);
SQL: SELECT COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'R' AND genre = 'Horror' AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2015
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: What are the names of the characters voiced by Frank Welker?
Evidence: Frank Welker refers to voice-actor = 'Frank Welker';
SQL: SELECT character FROM `voice-actors` WHERE 'voice-actor' = 'Frank Welker'
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: How much is the total gross of the movie with a song titled "Little Wonders"?
Evidence: song = 'Little Wonders'
SQL: SELECT T1.total_gross FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.song = 'Little Wonders'
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: What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo?
Evidence: The Motion Picture Association of America rating refers to MPAA_rating; villian = 'Turbo';
SQL: SELECT T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.villian = 'Turbo'
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: How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor?
Evidence: movies for mature audiences or parental guidance refer to movie_title where MPAA_rating = 'PG';
SQL: SELECT COUNT(T.movie) FROM ( SELECT T1.movie FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE MPAA_rating = 'PG' AND `voice-actor` = 'Bill Thompson' GROUP BY T1.movie ) AS T
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: How many of Gary Trousdale's movies are adventure movies?
Evidence: Gary Trousdale refers director = 'Gary Trousdale'; the adventure movie refers to genre = 'Adventure';
SQL: SELECT COUNT(T.name) FROM ( SELECT T1.name FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Gary Trousdale' AND T2.genre = 'Adventure' GROUP BY T1.name ) T