db_id
stringclasses
68 values
question
stringlengths
24
325
evidence
stringlengths
0
580
SQL
stringlengths
23
728
mental_health_survey
In 2019, how many users in the United States have a family history of mental illness?
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
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'
mental_health_survey
Betweeen 2016 to 2019, which year recorded the highest number of people with mental illness?
Between 2016 to 2019 refer to SurveyID 2016 BETWEEN 2019; People with mental illness refers to AnswerText = 'Yes' where questionid = 34
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
mental_health_survey
How many female users were surveyed in the mental health survey for 2017 in the state of Nebraska?
AnswerText = 'Yes' where questiontext = 'Do you have a family history of mental illness?'; AnswerText = 'Female' where questionid = 2; AnswerText = 'Nebraska' where questionid = 4
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' )
mental_health_survey
How many users believed that their productivity is ever affected by a mental health issue overall?
Users who believed that their productivity is affected by a mental health issues overall refers to AnswerText = 'Yes' where questionid = 54
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'
mental_health_survey
What are the ages of the oldest and youngest user that were surveyed? Indicate their user id.
Oldest user refer to MAX(AnswerText) where questionid = 1; Youngest user refer to MIN(AnswerText) where questionid = 1
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
mental_health_survey
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.
Country with least number of users being surveyed refers to MIN(COUNT(AnswerText)) where questionid = 3
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
mental_health_survey
What is the percentage of the the users who would bring up a mental health issue with a potential employer in an interview?
Percentage = DIVIDE(SUM(AnswerText = 'Yes' Or AnswerText = 'Maybe'), COUNT(QuestionID = 12))* 100
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
mental_health_survey
What is the oldest age of the users in 2014's survey?
what is your age? refer to QuestionText; 2014 refer to SurveyID; oldest age refers to MAX(AnswerText)
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
mental_health_survey
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?
2014 refer to SurveyID; Answered No refer to AnswerText = 'No'; Question refer to questiontext
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'
mental_health_survey
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.
2014 refer to SurveyID; Question refer to questiontext; yes refer to AnswerText = 'Yes'
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
mental_health_survey
How many users participated in the mental health survey for 2014?
mental health survey for 2014 refers to SurveyID = 2014
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'
mental_health_survey
Please list all the common questions in 2014's survey and 2016's survey.
question refers to questiontext; all the common questions in 2014's survey and 2016's survey refers to QuestionID(SurveyID(2014)) = QuestionID(SurveyID(2016))
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
mental_health_survey
How many users lived in Canada according to 2018's survey?
lived in Canada refers to AnswerText(QuestionID(3)) = 'Canada'
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'
mental_health_survey
Please list all the questions in the mental health survey for 2014.
mental health survey for 2014 refers to SurveyID = 2014
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
mental_health_survey
According to 2016's survey, what is the number of users with a mental health disorder in the past?
users with a mental health disorder in the past refers to AnswerText(QuestionID(32)) = '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 'Have you had a mental health disorder in the past?' AND T2.AnswerText = 'Yes'
mental_health_survey
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?
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
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'
mental_health_survey
What is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey?
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)))
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' )
mental_health_survey
Tell the question ID for "Would you bring up a physical health issue with a potential employer in an interview?".
SELECT questionid FROM Question WHERE questiontext LIKE 'Would you bring up a physical health issue with a potential employer in an interview?'
mental_health_survey
How many users answered the question No.20?
question No.20 refers to QuestionID = 20
SELECT MAX(UserID) - MIN(UserID) + 1 FROM Answer WHERE QuestionID = 20
mental_health_survey
How many questions did user No.5 answer?
user No.5 refers to userID = 5
SELECT COUNT(QuestionID) FROM Answer WHERE UserID = 5
mental_health_survey
State the number of questions that were asked in the "mental health survey for 2018".
mental health survey for 2018 refers to SurveyID = 2018
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'
mental_health_survey
Tell the number of surveys that contained the question “What country do you work in?”.
question refers to questiontext
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?'
mental_health_survey
What answer did user No. 2681 give to the question "Do you currently have a mental health disorder?"?
question refers to questiontext; user No. 2681 refers to UserID = 2681
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
mental_health_survey
Provide the number of users who took part in the "mental health survey for 2016".
mental health survey for 2016 refers to SurveyID = 2016
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'
mental_health_survey
What was the most common answer for the question "What country do you work in?"?
most common answer refers to AnswerText where MAX(COUNT(AnswerText(QuestionID = 3)))
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
mental_health_survey
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?
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.'
mental_health_survey
For the question “What US state or territory do you work in?”, how many people gave "Kansas" as the answer?
question refers to questiontext; AnswerText = 'Kansas'
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'
mental_health_survey
How many people wrote comments for the question "Any additional notes or comments."?
question refers to questiontext; wrote comments refers to AnswerText(QuestionID = 103) ! = -1
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
mental_health_survey
For all the users who have been asked "Have you ever been diagnosed with a mental health disorder?", how many of them said "Yes"?
have asked refers to questiontext; said 'Yes' refers to AnswerText = 'Yes'
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'
mental_health_survey
Give the number of users who took the "mental health survey for 2018".
mental health survey for 2018 refers to SurveyID = 2018
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'
mental_health_survey
How many users answered the question "Overall, how much importance does your employer place on physical health?"?
question refers to questiontext
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?'
mental_health_survey
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)?"?
percentage = divide(count(QuestionID = 15& AnswerText = 'Yes'), count(QuestionID = 15))*100%
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)?'
mental_health_survey
How many times more for the number of users who took the "mental health survey for 2017" than "mental health survey for 2018"?
How many times more = subtract(count(UserID(SurveyID = 2017)), count(UserID(SurveyID = 2018)))
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'
mental_health_survey
Among respondents who participated in the survey in 2016, what percentage had a mental health disorder in the past?
respondents and 'users' are synonyms; percentage = divide(count(SurveyID = 2016& QuestionID = 32 & AnswerText = 'Yes'), count(SurveyID = 2016& QuestionID = 32))*100%
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
mental_health_survey
What is the average number of respondents per survey between 2014 and 2019?
respondents and 'users' are synonyms; average number = avg(count(userID(SurveyID = 2014)), count(userID(SurveyID = 2019)))
SELECT CAST(COUNT(SurveyID) AS REAL) / 5 FROM Answer WHERE SurveyID BETWEEN 2014 AND 2019
mental_health_survey
How many respondents who participated in the survey in 2014 work remotely at least 50% of the time?
respondents' and 'users' are synonyms; work remotely at least 50% of the time refers to AnswerText(SurveyID = 2014& QuestionID = 93) = 'Yes'
SELECT COUNT(T1.AnswerText) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 93 AND T1.SurveyID = 2014 AND T1.AnswerText = 'Yes'
mental_health_survey
How many questions were asked in the questionary for the mental health survey?
SELECT COUNT(questiontext) FROM Question
mental_health_survey
How many respondents of the mental health survey were diagnosed with 'Substance Use Disorder'?
respondents' and 'users' are synonyms
SELECT COUNT(AnswerText) FROM Answer WHERE AnswerText LIKE 'Substance Use Disorder'
mental_health_survey
List the top three popular responses to the question of the survey in 2017 with the question ID no.85.
survey in 2017 refers to SurveyID = 2017; questionID = 85; MAX(COUNT(AnswerText))
SELECT AnswerText FROM Answer WHERE QuestionID = 85 AND SurveyID = 2017 GROUP BY AnswerText ORDER BY COUNT(AnswerText) DESC LIMIT 3
disney
Who is the director of the movie Pinocchio?
Pinocchio is the name of the movie;
SELECT director FROM director WHERE name = 'Pinocchio'
disney
Please list the villains of all the movies directed by Wolfgang Reitherman.
Wolfgang Reitherman refers to director = 'Wolfgang Reitherman';
SELECT T2.villian FROM director AS T1 INNER JOIN characters AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' AND T2.villian IS NOT NULL
disney
The song "Once Upon a Dream" is associated with the movie directed by whom?
directed by whom refers to director; movie refers to movie_title;
SELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.song = 'Once Upon a Dream'
disney
Among the movies directed by Wolfgang Reitherman, which one of them was the most popular?
directed by Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; the most popular movie refers to MAX(total_gross);
SELECT T2.movie_title FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Wolfgang Reitherman' ORDER BY T2.total_gross DESC LIMIT 1
disney
What is the genre of the movie whose villain is Commander Rourke?
FALSE;
SELECT T2.genre FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T1.villian = 'Commander Rourke'
disney
Who is the villain of the movie "Beauty and the Beast"?
Beauty and the Beast refers to movie_title = 'Beauty and the Beast';
SELECT villian FROM characters WHERE movie_title = 'Beauty and the Beast'
disney
Which movie is the character Robin Hood in?
Robin Hood is the main character of the movie which refers to hero = 'Robin Hood'; movie refers to movie_title;
SELECT movie_title FROM characters WHERE hero = 'Robin Hood'
disney
Give the name of the movie which the song "I Thought I Lost You" is associated with.
name of the movie refers to movie_title;
SELECT movie_title FROM characters WHERE song = 'I Thought I Lost You'
disney
Who is the hero character of the movie whose total gross was $222,527,828?
FALSE;
SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.total_gross = '$222,527,828'
disney
Who is the hero character of the Disney movie directed by Will Finn?
Will Finn refers to director = 'Will Finn';
SELECT T1.hero FROM characters AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Will Finn'
disney
Who is the director of the adventure movie which was released on 2007/3/30?
released on 2007/3/30 refers to release_date = 'Mar 30, 2007'; adventure movie refers to genre = 'Adventure' ;
SELECT T1.director FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.name WHERE T2.genre = 'Adventure' AND T2.release_date = 'Mar 30, 2007'
disney
Wolfgang Reitherman has directed several Disney movies, which one has the highest grossing after accounting for inflation?
Wolfgang Reitherman refers to director = 'Wolfgang Reitherman'; the highest grossing after accounting for inflation refers to MAX(inflation_adjusted_gross);
SELECT T1.movie_title FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' ORDER BY CAST(REPLACE(SUBSTR(inflation_adjusted_gross, 2), ',', '') AS REAL) DESC LIMIT 1
disney
Who is the hero character of the adventure movie which was released on 2016/3/4?
released on 2016/3/4 refers to release_date = '4-Mar-16'; adventure movie refers to genre = 'Adventure' ;
SELECT T1.hero FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie_title WHERE T2.genre = 'Adventure' AND T1.release_date = '4-Mar-16'
disney
How many movies did Wolfgang Reitherman direct?
Wolfgang Reitherman refers director = 'Wolfgang Reitherman';
SELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman'
disney
Who is the most productive director?
Most productive director refers to director where MAX(COUNT(name));
SELECT director FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1
disney
How much is the total gross of the movie with a song titled "Little Wonders"?
song = 'Little Wonders'
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'
disney
What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo?
The Motion Picture Association of America rating refers to MPAA_rating; villian = 'Turbo';
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'
disney
How many of Gary Trousdale's movies are adventure movies?
Gary Trousdale refers director = 'Gary Trousdale'; the adventure movie refers to genre = 'Adventure';
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
disney
What is the most popular movie directed by Ron Clements?
Ron Clements refers to director = 'Ron Clements'; the most popular movie refers to movie_title where MAX(total_gross);
SELECT T2.name FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Ron Clements' ORDER BY CAST(REPLACE(SUBSTR(total_gross, 2), ',', '') AS int) DESC LIMIT 1
disney
How many PG adventure movies did Ron Clements direct?
Ron Clements refers to director = 'Ron Clements'; PG is an abbreviation for parental guidance and refers to MPAA_rating = 'PG'; adventure movie refers to genre = 'Adventure';
SELECT COUNT(*) FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Ron Clements' AND T2.MPAA_rating = 'PG' AND T2.genre = 'Adventure'
disney
Who is the villain in the movie "The Great Mouse Detective"?
The Great Mouse Detective refers to movie_title = 'The Great Mouse Detective';
SELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective'
disney
Which director has made the most movies?
the most movies refers to MAX(COUNT(name));
SELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1
disney
List all the songs associated with drama movies.
drama refers to genre = 'Drama';
SELECT song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Drama' GROUP BY song
disney
What is the highest grossing movie without a song?
the highest grossing movie without song refers to movie_title where MAX(total_gross) and song = 'null';
SELECT T1.movie_title FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie_title WHERE T2.song IS NULL ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
List the directors of movies that feature a song.
movies that feature a song refer to movie_title where song is not NULL;
SELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.song IS NOT NULL GROUP BY T2.director
disney
Which of the movies directed by Ron Clements has the highest total gross?
Ron Clements refer to director = 'Ron Clements'; the highest total gross refers to MAX(total_gross);
SELECT T2.movie_title FROM director AS T1 INNER JOIN movies_total_gross AS T2 ON T1.name = T2.movie_title WHERE T1.director = 'Ron Clements' ORDER BY CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
What proportion of the total gross of all movies is from movies with songs?
Movies with songs refer song = 'not null'; DIVIDE(SUM(total_gross where song = 'not null'), sum(total_gross)) as percentage;
SELECT CAST(COUNT(CASE WHEN T1.song IS NOT NULL THEN T2.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T2.movie_title) FROM characters AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie_title = T2.movie_title
disney
List the movies and genres released in 2016.
released in 2016 refers to substr(release_date, length(release_date) - 3, length(release_date)) = '2016'; movies refer to the movie_title;
SELECT movie_title, genre FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '2016'
disney
List the movie titles directed by Jack Kinney.
Jack Kinney refers to director = 'Jack Kinney';
SELECT name FROM director WHERE director = 'Jack Kinney'
disney
List the PG-13 romantic comedy movie titles and their release dates.
PG-13 refers to MPAA_rating = 'PG-13'; romantic comedy refers to genre = 'Romantic Comedy';
SELECT movie_title, release_date FROM movies_total_gross WHERE MPAA_rating = 'PG-13' AND genre = 'Romantic Comedy'
disney
List the movie titles and associated songs directed by Ron Clements.
Ron Clements refers director = 'Ron Clements';
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'
disney
Provide the titles, main characters, and associated songs of the movies directed by Wolfgang Reitherman in 1977.
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;
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'
disney
Which movies had the main character named Donald Duck and who directed them?
Donald Duck is the main character of the movie which refers to hero = 'Donald Duck'; movies refer to movie_title; who directed refers director;
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'
disney
Describe the hero, director, and the release date of Mulan.
Mulan refers to movie_title = 'Mulan';
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'
disney
Provide the title, total gross, and MPAA rating of the movie which has a hero named Elsa.
Elsa is the main character of the movie which refers to hero = 'Elsa'; title refers to movie_title;
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'
disney
Who directed the most popular movie?
The most popular movie refers MAX(total_gross); who directed refers to director;
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
disney
Provide the director's name of Wreck-It Ralph movie.
Wreck-It Ralph is the name of the movies which refers to name = 'Wreck-It Ralph';
SELECT director FROM director WHERE name = 'Wreck-It Ralph'
disney
What movies did director Jack Kinney direct?
FALSE;
SELECT name FROM director WHERE director = 'Jack Kinney'
disney
How many movies were released between 1937 and 1950?
released between 1937 and 1950 refers to substr(release_date, length(release_date) - 1,length(release_date)) between '37' and '50';
SELECT COUNT(movie_title) FROM characters WHERE SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) BETWEEN '37' AND '50'
disney
Provide the name of the song from the movie directed by Ben Sharpsteen.
Ben Sharpsteen refers to director = 'Ben Sharpsteen';
SELECT T1.song FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Ben Sharpsteen'
disney
Indicate the release date of the film The Lion King directed by Roger Allers.
The Lion King refers to movie_title = 'The Lion King'; Roger Allers refers to director = 'Roger Allers';
SELECT T1.release_date FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Roger Allers' AND T1.movie_title = 'The Lion King'
disney
Which movies of director Wolfgang Reitherman do not have villain?
which movies do not have villain refer to movie_title where villian is null;
SELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' AND T1.villian IS NULL
disney
List the titles of movies directed by Jack Kinney that were released before 1947.
Jack Kinney refers to director = 'Jack Kinney'; released before 1947 refers to substr(release_date, length(release_date) - 1, length(release_date)) < '47';
SELECT T1.movie_title FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Jack Kinney' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 1, LENGTH(T1.release_date)) < '47'
disney
List the names of the directors whose films grossed over $100 million.
films grossed over $100 million refer to movie_title where total_gross > 100000000;
SELECT DISTINCT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name INNER JOIN movies_total_gross AS T3 ON T1.movie_title = T3.movie_title WHERE CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL) > 100000000
disney
Which movie's song title has the highest total gross?
The highest total gross refers to MAX(total_gross);
SELECT T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
Which director had the most popular film from 1937 to 1990?
from 1937 to 1990 refers to substr(release_date, length(release_date) - 3, length(release_date)) between '1937' and '1990'; the most popular film refers to movie_title where MAX(total_gross);
SELECT T2.director FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name INNER JOIN movies_total_gross AS T3 ON T3.movie_title = T1.movie_title WHERE SUBSTR(T3.release_date, LENGTH(T3.release_date) - 3, LENGTH(T3.release_date)) BETWEEN '1937' AND '1990' ORDER BY CAST(REPLACE(trim(T3.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
List all the main characters of the movie that are comedy genre.
Comedy refers to genre = 'Comedy'; the main character of the movie refers to hero;
SELECT T2.hero FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Comedy'
disney
What genre of movie has Taran as the main character?
Taran is the main character of the movie which refers to hero = 'Taran';
SELECT T1.genre FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T2.hero = 'Taran'
disney
Calculate the percentage of directors whose films grossed over $100 million.
DIVIDE(COUNT(director where total_gross > 100000000), COUNT(director)) as percentage;
SELECT CAST(COUNT(DISTINCT CASE WHEN CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) > 100000000 THEN T3.director ELSE NULL END) AS REAL) * 100 / COUNT(DISTINCT T3.director) 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
disney
Name the first movie released by Disney.
The first movie released refers to movie_title where substr(release_date, length(release_date) - 1, length(release_date)) asc limit 1;
SELECT movie_title FROM characters ORDER BY SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) ASC LIMIT 1
disney
How many movies were released by Disney between 2010 and 2016?
Movies refer to movie_title; released between 2010 and 2016 refers to substr(release_date, length(release_date) - 1, length(release_date)) between '10' and '16';
SELECT COUNT(movie_title) FROM characters WHERE SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) BETWEEN '10' AND '16'
disney
Who was the first ever Disney villain?
the first ever villian is villian that was released before all others in time which refers to substr(release_date, length(release_date) - 1, length(release_date)) desc limit 1;
SELECT villian FROM characters ORDER BY SUBSTR(release_date, LENGTH(release_date) - 1, LENGTH(release_date)) DESC LIMIT 1
disney
What is Disney's highest grossing action movie?
action movie refers to movie_title where genre = 'Action'; highest grossing movie refers to MAX(total_gross)
SELECT movie_title FROM movies_total_gross WHERE genre = 'Action' ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
Name the main character of Disney's most popular adventure movie based on its inflation-adjusted gross.
adventure movie refers to genre = 'Adventure'; the main character of the movie refers to hero; most popular movie based on its inflation-adjusted gross refers to where MAX(inflation_adjusted_gross);
SELECT T2.hero FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T1.genre = 'Adventure' ORDER BY CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) DESC LIMIT 1
disney
Name the director of Disney's lowest grossing movie.
lowest grossing movie refers to movie_title where MIN(total_gross);
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) ASC LIMIT 1
disney
Determine the average gross for Disney's PG-13-rated action movies.
DIVIDE(SUM(total_gross where genre = 'Action' and MPAA_rating = 'PG-13'), COUNT(movie_title where genre = 'Action' and MPAA_rating = 'PG-13'));
SELECT SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) / COUNT(movie_title) FROM movies_total_gross WHERE MPAA_rating = 'PG-13'
disney
Find the estimated inflation rate that was used to adjust the 1995 box office revenue for Disney's films.
DIVIDE(inflation_adjusted_gross, total_gross) as percentage where substr(release_date, length(release_date) - 3, length(release_date)) = '1995';
SELECT SUM(CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL)) / SUM(CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL)) FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995' GROUP BY SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '1995'
disney
What is the difference in the current gross of Cars and its sequel, Cars 2? Which movie is more popular?
SUBTRACT(inflation_adjusted_gross where movie_title = 'Cars', inflation_adjusted_gross where movie_title = 'Cars 2'); more popular movie refers to movie_title where MAX(inflation_adjusted_gross);
SELECT SUM(CASE WHEN movie_title = 'Cars' THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END), SUM(CASE WHEN movie_title = 'Cars 2' THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END) FROM movies_total_gross
disney
Name the top 5 highest-grossing Disney movies adjusted for inflation. Identify the percentage they contributed to the total of Disney's current gross.
The top 5 highest-grossing movies adjusted for inflation refer to MAX(inflation_adjusted_gross)LIMIT 5; DIVIDE(SUM(MAX(inflation_adjusted_gross LIMIT 5)), SUM(inflation_adjusted_gross)) as percentage;
SELECT SUM(CASE WHEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) > 1236035515 THEN CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) ELSE 0 END) * 100 / SUM(CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL)) FROM movies_total_gross
disney
Among all Disney movies directed by Gary Trousdale, determine the percentage that earned over USD100m based on actual grossing.
DIVIDE(COUNT(movie_title where director = 'Gary Trousdale' and total_gross > 100000000), COUNT(movie_title where director = 'Gary Trousdale')) as percentage;
SELECT CAST(COUNT(CASE WHEN CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) > 100000000 THEN T1.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_title) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Gary Trousdale'
legislator
How many current legislators do not have an account on ballotpedia.org ?
do not have an account on ballotpedia.org refers to ballotpedia_id IS NULL OR ballotpedia_id = ''
SELECT COUNT(*) FROM current WHERE ballotpedia_id = '' OR ballotpedia_id IS NULL