problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: Please list all the answers to the question "Any additional notes or comments" that are not null in 2014's survey.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT T2.AnswerText FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T1.questiontext = 'Any additional notes or comments' AND T2.SurveyID = 2014 AND T2.AnswerText <> -1 |
Write SQL query to solve given problem: Please list all the common questions in 2014's survey and 2016's survey.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT T1.questiontext FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID IN (2014, 2016) GROUP BY T1.questiontext |
Write SQL query to solve given problem: How many users lived in Canada according to 2018's survey?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2018 AND T1.questiontext = 'What country do you live in?' AND T2.AnswerText = 'Canada' |
Write SQL query to solve given problem: Please list all the questions in the mental health survey for 2014.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT T2.questiontext FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid INNER JOIN Survey AS T3 ON T1.SurveyID = T3.SurveyID WHERE T3.Description LIKE 'mental health survey for 2014' GROUP BY T2.questiontext |
Write SQL query to solve given problem: According to 2016's survey, what is the number of users with a mental health disorder in the past?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2016 AND T1.questiontext LIKE 'Have you had a mental health disorder in the past?' AND T2.AnswerText = 'Yes' |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID IN (2016, 2017, 2018) AND T1.questiontext LIKE 'Have you had a mental health disorder in the past?' AND T2.AnswerText = 'Yes' |
Write SQL query to solve given problem: What is the average result of the question "What is your age?" in 2014's survey?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT CAST(SUM(T2.AnswerText) AS REAL) / COUNT(T2.UserID) AS "avg" FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2014 AND T1.questiontext LIKE 'What is your age?' |
Write SQL query to solve given problem: What is the rate of increase of users with a current mental disorder from 2019's survey to 2016's survey?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT CAST(( SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.questionid = T2.QuestionID WHERE T2.SurveyID = 2019 AND T1.questiontext LIKE 'Do you currently have a mental health disorder?' AND T2.AnswerText = 'Yes' ) - ( SELECT COUNT(T2.UserID) FROM Question AS T1 INNER JOIN Answer AS T2 ON T1.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' ) |
Write SQL query to solve given problem: Tell the question ID for "Would you bring up a physical health issue with a potential employer in an interview?".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT questionid FROM Question WHERE questiontext LIKE 'Would you bring up a physical health issue with a potential employer in an interview?' |
Write SQL query to solve given problem: How many users answered the question No.20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT MAX(UserID) - MIN(UserID) + 1 FROM Answer WHERE QuestionID = 20 |
Write SQL query to solve given problem: How many questions did user No.5 answer?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(QuestionID) FROM Answer WHERE UserID = 5 |
Write SQL query to solve given problem: How many users participated in the Survey No.2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(DISTINCT UserID) FROM Answer WHERE SurveyID LIKE 2016 |
Write SQL query to solve given problem: State the number of questions that were asked in the "mental health survey for 2018".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(T1.QuestionID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018' |
Write SQL query to solve given problem: Tell the number of surveys that contained the question “What country do you work in?”.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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?' |
Write SQL query to solve given problem: What answer did user No. 2681 give to the question "Do you currently have a mental health disorder?"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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 |
Write SQL query to solve given problem: Provide the number of users who took part in the "mental health survey for 2016".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2016' |
Write SQL query to solve given problem: What was the most common answer for the question "What country do you work in?"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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 |
Write SQL query to solve given problem: 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?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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.' |
Write SQL query to solve given problem: For the question “What US state or territory do you work in?”, how many people gave "Kansas" as the answer?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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' |
Write SQL query to solve given problem: How many people wrote comments for the question "Any additional notes or comments."?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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 |
Write SQL query to solve given problem: For all the users who have been asked "Have you ever been diagnosed with a mental health disorder?", how many of them said "Yes"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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' |
Write SQL query to solve given problem: Give the number of users who took the "mental health survey for 2018".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Survey AS T2 ON T1.SurveyID = T2.SurveyID WHERE T2.Description = 'mental health survey for 2018' |
Write SQL query to solve given problem: How many users answered the question "Overall, how much importance does your employer place on physical health?"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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?' |
Write SQL query to solve given problem: For which question did the user No.2183 gave the answer "Mood Disorder (Depression, Bipolar Disorder, etc)"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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)' |
Write SQL query to solve given problem: 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)?"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT CAST(SUM(CASE WHEN T1.AnswerText LIKE 'Yes' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T2.questiontext LIKE 'Has your employer ever formally discussed mental health (for example, as part of a wellness campaign or other official communication)?' |
Write SQL query to solve given problem: How many times more for the number of users who took the "mental health survey for 2017" than "mental health survey for 2018"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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' |
Write SQL query to solve given problem: Among respondents who participated in the survey in 2016, what percentage had a mental health disorder in the past?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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 |
Write SQL query to solve given problem: How many respondents younger than 25 years old did participate in the survey in 2016?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(DISTINCT T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 1 AND T1.SurveyID = 2016 AND T1.AnswerText <= 25 |
Write SQL query to solve given problem: What is the average number of respondents per survey between 2014 and 2019?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT CAST(COUNT(SurveyID) AS REAL) / 5 FROM Answer WHERE SurveyID BETWEEN 2014 AND 2019 |
Write SQL query to solve given problem: How many respondents who participated in the survey in 2019 have ever sought treatment for a mental health disorder from a mental health professional?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(T1.UserID) FROM Answer AS T1 INNER JOIN Question AS T2 ON T1.QuestionID = T2.questionid WHERE T1.QuestionID = 7 AND T1.SurveyID = 2019 AND T1.AnswerText = 1 |
Write SQL query to solve given problem: How many respondents who participated in the survey in 2014 work remotely at least 50% of the time?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | 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' |
Write SQL query to solve given problem: How many questions were asked in the questionary for the mental health survey?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT COUNT(questiontext) FROM Question |
Write SQL query to solve given problem: List the top three popular responses to the question of the survey in 2017 with the question ID no.85.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | mental_health_survey | SELECT AnswerText FROM Answer WHERE QuestionID = 85 AND SurveyID = 2017 GROUP BY AnswerText ORDER BY COUNT(AnswerText) DESC LIMIT 3 |
Write SQL query to solve given problem: How much more total box office gross did the Walt Disney Company have in revenue in 1998 than in 1997?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT SUM(CASE WHEN `Year` = 1998 THEN Total ELSE 0 END) - SUM(CASE WHEN `Year` = 1997 THEN Total ELSE 0 END) FROM revenue |
Write SQL query to solve given problem: In which segment did the Walt Disney Company earned a bigger revenue in 1998, Studio Entertainment or Disney Media Networks?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT CASE WHEN 'Studio Entertainment[NI 1]' > 'Disney Media Networks' THEN 'Studio Entertainment[NI 1]' ELSE 'Disney Media Networks' END FROM revenue WHERE `Year` = 1998 |
Write SQL query to solve given problem: Who is the director of the movie Pinocchio?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT director FROM director WHERE name = 'Pinocchio' |
Write SQL query to solve given problem: Please list the villains of all the movies directed by Wolfgang Reitherman.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Among the movies directed by Wolfgang Reitherman, how many of them were released in December?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT COUNT(movie_title) FROM characters AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(release_date, INSTR(release_date, '-') + 1, 3) = 'Dec' AND T2.director = 'Wolfgang Reitherman' |
Write SQL query to solve given problem: The song "Once Upon a Dream" is associated with the movie directed by whom?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: Who is the voice actor for the villain of the movie "Alice in Wonderland"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.character LIKE '%' OR T2.villian OR '%' AND T2.movie_title = 'Alice in Wonderland' |
Write SQL query to solve given problem: Please list the release dates of all the movies in which Alan Tudyk is a voice actor.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Alan Tudyk' |
Write SQL query to solve given problem: Among the movies in which Alan Tudyk is a voice actor, how many of them were released after 2012?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT COUNT(T2.movie) FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Alan Tudyk' AND SUBSTR(release_date, INSTR(release_date, '-') + 5) > 12 |
Write SQL query to solve given problem: Among the movies directed by Wolfgang Reitherman, how many of them are Comedies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT COUNT(T3.name) FROM ( SELECT T2.name FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T2.director = 'Wolfgang Reitherman' AND T1.genre = 'Comedy' GROUP BY T2.name ) T3 |
Write SQL query to solve given problem: Among the movies directed by Wolfgang Reitherman, which one of them was the most popular?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Please list the movies directed by Wolfgang Reitherman that can be watched by the general audience.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.movie_title FROM `movies_total_gross` AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.MPAA_rating = 'G' AND T2.director = 'Wolfgang Reitherman' |
Write SQL query to solve given problem: Which character is the villain of the most popular movie?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.villian FROM `movies_total_gross` AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title ORDER BY T1.total_gross DESC LIMIT 1 |
Write SQL query to solve given problem: What is the genre of the movie whose villain is Commander Rourke?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: Who is the villain of the movie "Beauty and the Beast"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT villian FROM characters WHERE movie_title = 'Beauty and the Beast' |
Write SQL query to solve given problem: Which movie is the character Robin Hood in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie_title FROM characters WHERE hero = 'Robin Hood' |
Write SQL query to solve given problem: Give the name of the movie which the song "I Thought I Lost You" is associated with.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie_title FROM characters WHERE song = 'I Thought I Lost You' |
Write SQL query to solve given problem: Who is the voice actor of the character "Binkie Muddlefoot"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT `voice-actor` FROM `voice-actors` WHERE character = 'Binkie Muddlefoot' |
Write SQL query to solve given problem: Who is the hero character of the movie whose total gross was $222,527,828?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: Which song is associated with the most popular Disney movie in 1970s?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.song FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE CAST(SUBSTR(T1.release_date, INSTR(T1.release_date, ', ') + 1) AS int) BETWEEN 1970 AND 1979 ORDER BY CAST(REPLACE(SUBSTR(T1.total_gross, 2), ',', '') AS float) DESC LIMIT 1 |
Write SQL query to solve given problem: Who is the hero character of the Disney movie directed by Will Finn?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.hero FROM characters AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Will Finn' |
Write SQL query to solve given problem: Who is the voice actor of the hero character from the movie The Little Mermaid?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T1.movie_title = 'The Little Mermaid' AND T2.character = T1.hero |
Write SQL query to solve given problem: Give the name of the director of the movie in which Verna Felton was the voice actor for its character "Aunt Sarah".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.name WHERE T2.character = 'Aunt Sarah' AND T2.`voice-actor` = 'Verna Felton' |
Write SQL query to solve given problem: For the movie in which Tress MacNeille was the voice actor for its character "Hyacinth Hippo", what was the release date of that movie?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.release_date FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.movie = T1.movie_title WHERE T2.character = 'Hyacinth Hippo' AND T2.`voice-actor` = 'Tress MacNeille' |
Write SQL query to solve given problem: Who is the director of the adventure movie which was released on 2007/3/30?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: Wolfgang Reitherman has directed several Disney movies, which one has the highest grossing after accounting for inflation?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Who is the hero character of the adventure movie which was released on 2016/3/4?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: The character Donald Duck has appeared in two Disney movies, which one has more grossing?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.movie_title FROM movies_total_gross AS T1 INNER JOIN characters AS T2 ON T1.movie_title = T2.movie_title WHERE T2.hero = 'Donald Duck' ORDER BY CAST(REPLACE(SUBSTR(total_gross, 2), ',', '') AS REAL) DESC LIMIT 1 |
Write SQL query to solve given problem: How many movies did Wolfgang Reitherman direct?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman' |
Write SQL query to solve given problem: Who is the most productive director?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT director FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1 |
Write SQL query to solve given problem: How many restricted horror movies were released between 1/1/1990 to 12/31/2015?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: What are the names of the characters voiced by Frank Welker?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT character FROM `voice-actors` WHERE 'voice-actor' = 'Frank Welker' |
Write SQL query to solve given problem: How much is the total gross of the movie with a song titled "Little Wonders"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: What is the Motion Picture Association of America rating for the movie featuring a villain named Turbo?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: How many of Gary Trousdale's movies are adventure movies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Which director did Bill Thompson work the most with?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT director FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T2.`voice-actor` = 'Bill Thompson' GROUP BY director ORDER BY COUNT(director) DESC LIMIT 1 |
Write SQL query to solve given problem: What is the most popular movie directed by Ron Clements?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 INNER JOIN movies_total_gross AS T3 ON T1.name = T2.movie AND T2.movie = T3.movie_title WHERE T1.director = 'Ben Sharpsteen' AND T3.release_date = 'Feb 9, 1940' AND T2.`voice-actor` != 'None' GROUP BY T2.`voice-actor` |
Write SQL query to solve given problem: How many PG adventure movies did Ron Clements direct?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: How many horror movies are there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror' |
Write SQL query to solve given problem: Who is the villain in the movie "The Great Mouse Detective"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective' |
Write SQL query to solve given problem: List the voice actors from the movie "Meet the Robinsons".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT 'voice-actor' FROM `voice-actors` WHERE movie = 'Meet the Robinsons' |
Write SQL query to solve given problem: Which director has made the most movies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1 |
Write SQL query to solve given problem: From 2000 to 2010, in which year did the studio entertainment segment make the most revenue?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT `Year` FROM revenue WHERE `Year` BETWEEN 2000 AND 2010 ORDER BY `Studio Entertainment[NI 1]` DESC LIMIT 1 |
Write SQL query to solve given problem: List all the songs associated with drama movies.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Who are the voice actors for all the heroes?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.`voice-actor` FROM characters AS T1 INNER JOIN `voice-actors` AS T2 ON T2.character = T1.hero WHERE T2.movie = T1.movie_title |
Write SQL query to solve given problem: Provide a list of directors from the 1990s.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name AND CAST(SUBSTR(release_date, INSTR(release_date, ', ') + 1) AS int) BETWEEN 1990 AND 2000 GROUP BY T2.director |
Write SQL query to solve given problem: Who voiced the villain in "The Rescuers"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T2.movie_title = T1.movie WHERE T2.movie_title = 'The Rescuers' AND T1.character = T2.villian |
Write SQL query to solve given problem: List all of Wolfgang Reitherman's movies and their voice actors.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T1.name, T2.`voice-actor` FROM director AS T1 INNER JOIN `voice-actors` AS T2 ON T1.name = T2.movie WHERE T1.director = 'Wolfgang Reitherman' |
Write SQL query to solve given problem: What are the characters in the PG movies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT DISTINCT T2.character FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.MPAA_rating = 'PG' |
Write SQL query to solve given problem: What is the highest grossing movie without a song?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: Who directed the movie with the most voice actors?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.director, COUNT(DISTINCT T1.`voice-actor`) FROM `voice-actors` AS T1 INNER JOIN director AS T2 ON T1.movie = T2.name GROUP BY T2.director ORDER BY COUNT(DISTINCT T1.`voice-actor`) DESC LIMIT 1 |
Write SQL query to solve given problem: Who are the voice actors in the movie that came out on 11/24/2010?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.`voice-actor` FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T1.release_date = 'Nov 24, 2010' |
Write SQL query to solve given problem: List the directors of movies that feature a song.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: What are the total grosses for the movies with Jim Cummings as the voice actor?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT T2.movie_title FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T2.movie_title = T1.movie WHERE T1.`voice-actor` = 'Jim Cummings' ORDER BY CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1 |
Write SQL query to solve given problem: Which of the movies directed by Ron Clements has the highest total gross?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: What is the average total gross for the movies featuring Sterling Holloway?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT SUM(CAST(REPLACE(trim(T2.total_gross, '$'), ',', '') AS REAL)) / COUNT(T2.movie_title) FROM `voice-actors` AS T1 INNER JOIN movies_total_gross AS T2 ON T1.movie = T2.movie_title WHERE T1.`voice-actor` = 'Sterling Holloway' |
Write SQL query to solve given problem: What proportion of the total gross of all movies is from movies with songs?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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 |
Write SQL query to solve given problem: List the movies and genres released in 2016.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie_title, genre FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '2016' |
Write SQL query to solve given problem: Who is the villain in Little Mermaid?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT villian FROM characters WHERE movie_title = 'Little Mermaid' |
Write SQL query to solve given problem: List the movie titles directed by Jack Kinney.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT name FROM director WHERE director = 'Jack Kinney' |
Write SQL query to solve given problem: Provide the movie titles and the estimated inflation rate of the highest total grossed movie.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie_title, CAST(REPLACE(trim(inflation_adjusted_gross, '$'), ',', '') AS REAL) / CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) FROM movies_total_gross ORDER BY CAST(REPLACE(trim(total_gross, '$'), ',', '') AS REAL) DESC LIMIT 1 |
Write SQL query to solve given problem: List the PG-13 romantic comedy movie titles and their release dates.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie_title, release_date FROM movies_total_gross WHERE MPAA_rating = 'PG-13' AND genre = 'Romantic Comedy' |
Write SQL query to solve given problem: List the movie titles and character names by Bill Thompson.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | SELECT movie, character FROM `voice-actors` WHERE 'voice-actor' = 'Bill Thompson' |
Write SQL query to solve given problem: List the movie titles and associated songs directed by Ron Clements.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Write SQL query to solve given problem: Provide the titles, main characters, and associated songs of the movies directed by Wolfgang Reitherman in 1977.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | disney | 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' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.