input
stringlengths
122
2.7k
output
stringlengths
24
805
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Survey : SurveyID [ INTEGER ] primary_key Description [ TEXT ] Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following que...
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?';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: What answer did user No. 2681 give to the question "Do y...
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;
[INST] Here is a database schema: Survey : SurveyID [ INTEGER ] primary_key Description [ TEXT ] Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: Provide the number of users who took part in the "mental heal...
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';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: What was the most common answer for the question "What c...
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;
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many different answers did the question "Describe th...
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....
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: For the question “What US state or territory do you work...
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';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many people wrote comments for the question "Any add...
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;
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: For all the users who have been asked "Have you ever bee...
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';
[INST] Here is a database schema: Survey : SurveyID [ INTEGER ] primary_key Description [ TEXT ] Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: Give the number of users who took the "mental health survey f...
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';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many users answered the question "Overall, how much ...
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?';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: For which question did the user No.2183 gave the answer ...
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)';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: What was the percentage for the answer of "Yes" was give...
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 ...
[INST] Here is a database schema: Survey : SurveyID [ INTEGER ] primary_key Description [ TEXT ] Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many times more for the number of users who took the "men...
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';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: Among respondents who participated in the survey in 2016...
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;
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many respondents younger than 25 years old did parti...
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;
[INST] Here is a database schema: Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: What is the average number of respondents per survey between 2014 and 2019? [/INST] [/INST]
SELECT CAST(COUNT(SurveyID) AS REAL) / 5 FROM Answer WHERE SurveyID BETWEEN 2014 AND 2019;
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many respondents who participated in the survey in 2...
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;
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many respondents who participated in the survey in 2...
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';
[INST] Here is a database schema: Question : questiontext [ TEXT ] questionid [ INTEGER ] primary_key Please write me a SQL statement that answers the following question: How many questions were asked in the questionary for the mental health survey? [/INST] [/INST]
SELECT COUNT(questiontext) FROM Question;
[INST] Here is a database schema: Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: How many respondents of the mental health survey were diagnosed with 'Substance Use Disorder'? [/INST] [/INST]
SELECT COUNT(AnswerText) FROM Answer WHERE AnswerText LIKE 'Substance Use Disorder';
[INST] Here is a database schema: Answer : AnswerText [ TEXT ] SurveyID [ INTEGER ] UserID [ INTEGER ] QuestionID [ INTEGER ] Please write me a SQL statement that answers the following question: List the top three popular responses to the question of the survey in 2017 with the question ID no.85. [/INST] [/INST]
SELECT AnswerText FROM Answer WHERE QuestionID = 85 AND SurveyID = 2017 GROUP BY AnswerText ORDER BY COUNT(AnswerText) DESC LIMIT 3;
[INST] Please write me a SQL statement that answers the following question: How much more total box office gross did the Walt Disney Company have in revenue in 1998 than in 1997? [/INST] [/INST]
SELECT SUM(CASE WHEN `Year` = 1998 THEN Total ELSE 0 END) - SUM(CASE WHEN `Year` = 1997 THEN Total ELSE 0 END) FROM revenue;
[INST] Please write me a SQL statement that answers the following question: In which segment did the Walt Disney Company earned a bigger revenue in 1998, Studio Entertainment or Disney Media Networks? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that answers the following question: Who is the director of the movie Pinocchio? [/INST] [/INST]
SELECT director FROM director WHERE name = 'Pinocchio';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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;
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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';
[INST] Please write me a SQL statement that answers the following question: Who is the voice actor for the villain of the movie "Alice in Wonderland"? [/INST] [/INST]
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';
[INST] Please write me a SQL statement that answers the following question: Please list the release dates of all the movies in which Alan Tudyk is a voice actor. [/INST] [/INST]
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';
[INST] Please write me a SQL statement that answers the following question: Among the movies in which Alan Tudyk is a voice actor, how many of them were released after 2012? [/INST] [/INST]
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;
[INST] Please write me a SQL statement that answers the following question: Among the movies directed by Wolfgang Reitherman, how many of them are Comedies? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: Please list the movies directed by Wolfgang Reitherman that can be watched by the general audience. [/INST] [/INST]
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';
[INST] Please write me a SQL statement that answers the following question: Which character is the villain of the most popular movie? [/INST] [/INST]
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;
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] Please write me a SQL statement that answers the following question: Who is the villain of the movie "Beauty and the Beast"? [/INST...
SELECT villian FROM characters WHERE movie_title = 'Beauty and the Beast';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] Please write me a SQL statement that answers the following question: Which movie is the character Robin Hood in? [/INST] [/INST]
SELECT movie_title FROM characters WHERE hero = 'Robin Hood';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] Please write me a SQL statement that answers the following question: Give the name of the movie which the song "I Thought I Lost Yo...
SELECT movie_title FROM characters WHERE song = 'I Thought I Lost You';
[INST] Please write me a SQL statement that answers the following question: Who is the voice actor of the character "Binkie Muddlefoot"? [/INST] [/INST]
SELECT `voice-actor` FROM `voice-actors` WHERE character = 'Binkie Muddlefoot';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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;
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
SELECT T1.hero FROM characters AS T1 INNER JOIN director AS T2 ON T2.name = T1.movie_title WHERE T2.director = 'Will Finn';
[INST] Please write me a SQL statement that answers the following question: Who is the voice actor of the hero character from the movie The Little Mermaid? [/INST] [/INST]
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;
[INST] Please write me a SQL statement that answers the following question: Give the name of the director of the movie in which Verna Felton was the voice actor for its character "Aunt Sarah". [/INST] [/INST]
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';
[INST] Please write me a SQL statement that answers the following question: For the movie in which Tress MacNeille was the voice actor for its character "Hyacinth Hippo", what was the release date of that movie? [/INST] [/INST]
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';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that answers the following question: How many movies did Wolfgang Reitherman direct? [/INST] [/INST]
SELECT COUNT(name) FROM director WHERE director = 'Wolfgang Reitherman';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that answers the following question: Who is the most productive director? [/INST] [/INST]
SELECT director FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1;
[INST] Here is a database schema: movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjusted_gross [ TEXT ] Please write me a SQL statement that answers the following question: How m...
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;
[INST] Please write me a SQL statement that answers the following question: What are the names of the characters voiced by Frank Welker? [/INST] [/INST]
SELECT character FROM `voice-actors` WHERE 'voice-actor' = 'Frank Welker';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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';
[INST] Please write me a SQL statement that answers the following question: How many movies for mature audiences or parental guidance suggested did Bill Thompson work as a voice actor? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: Which director did Bill Thompson work the most with? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: List all the voice actors in the movie directed by Ben Sharpsteen which was released on February 9, 1940. [/INST] [/INST]
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`;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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';
[INST] Please write me a SQL statement that answers the following question: How many horror movies are there? [/INST] [/INST]
SELECT COUNT(movie_title) FROM `movies_total_gross` WHERE genre = 'Horror';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] Please write me a SQL statement that answers the following question: Who is the villain in the movie "The Great Mouse Detective"? [...
SELECT villian FROM characters WHERE movie_title = 'The Great Mouse Detective';
[INST] Please write me a SQL statement that answers the following question: List the voice actors from the movie "Meet the Robinsons". [/INST] [/INST]
SELECT 'voice-actor' FROM `voice-actors` WHERE movie = 'Meet the Robinsons';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that answers the following question: Which director has made the most movies? [/INST] [/INST]
SELECT director, COUNT(name) FROM director GROUP BY director ORDER BY COUNT(name) DESC LIMIT 1;
[INST] Please write me a SQL statement that answers the following question: From 2000 to 2010, in which year did the studio entertainment segment make the most revenue? [/INST] [/INST]
SELECT `Year` FROM revenue WHERE `Year` BETWEEN 2000 AND 2010 ORDER BY `Studio Entertainment[NI 1]` DESC LIMIT 1;
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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;
[INST] Please write me a SQL statement that answers the following question: Who are the voice actors for all the heroes? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: Who voiced the villain in "The Rescuers"? [/INST] [/INST]
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;
[INST] Please write me a SQL statement that answers the following question: List all of Wolfgang Reitherman's movies and their voice actors. [/INST] [/INST]
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';
[INST] Please write me a SQL statement that answers the following question: What are the characters in the PG movies? [/INST] [/INST]
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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;
[INST] Please write me a SQL statement that answers the following question: Who directed the movie with the most voice actors? [/INST] [/INST]
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;
[INST] Please write me a SQL statement that answers the following question: Who are the voice actors in the movie that came out on 11/24/2010? [/INST] [/INST]
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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;
[INST] Please write me a SQL statement that answers the following question: What are the total grosses for the movies with Jim Cummings as the voice actor? [/INST] [/INST]
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;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: What is the average total gross for the movies featuring Sterling Holloway? [/INST] [/INST]
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT...
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;
[INST] Here is a database schema: movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjusted_gross [ TEXT ] Please write me a SQL statement that answers the following question: List ...
SELECT movie_title, genre FROM movies_total_gross WHERE SUBSTR(release_date, LENGTH(release_date) - 3, LENGTH(release_date)) = '2016';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] Please write me a SQL statement that answers the following question: Who is the villain in Little Mermaid? [/INST] [/INST]
SELECT villian FROM characters WHERE movie_title = 'Little Mermaid';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that answers the following question: List the movie titles directed by Jack Kinney. [/INST] [/INST]
SELECT name FROM director WHERE director = 'Jack Kinney';
[INST] Here is a database schema: movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjusted_gross [ TEXT ] Please write me a SQL statement that answers the following question: Provi...
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;
[INST] Here is a database schema: movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjusted_gross [ TEXT ] Please write me a SQL statement that answers the following question: List ...
SELECT movie_title, release_date FROM movies_total_gross WHERE MPAA_rating = 'PG-13' AND genre = 'Romantic Comedy';
[INST] Please write me a SQL statement that answers the following question: List the movie titles and character names by Bill Thompson. [/INST] [/INST]
SELECT movie, character FROM `voice-actors` WHERE 'voice-actor' = 'Bill Thompson';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEX...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] Please write me a SQL statement that ...
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';
[INST] Here is a database schema: characters : movie_title [ TEXT ] primary_key release_date [ TEXT ] hero [ TEXT ] characters.hero = voice-actors.character villian [ TEXT ] song [ TEXT ] director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEX...
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';
[INST] Please write me a SQL statement that answers the following question: Provide the title, director, and release date of the movie voice-acted by Freddie Jones. [/INST] [/INST]
SELECT T1.movie, T3.director, T2.release_date FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title INNER JOIN director AS T3 ON T3.name = T2.movie_title WHERE T1.`voice-actor` = 'Freddie Jones';
[INST] Please write me a SQL statement that answers the following question: Among Frank Welker's voice-acted movies, list the movie titles and the total gross when the estimated inflation rate was less than 2. [/INST] [/INST]
SELECT T1.movie_title, T1.total_gross FROM movies_total_gross AS T1 INNER JOIN `voice-actors` AS T2 ON T1.movie_title = T2.movie WHERE T2.`voice-actor` = 'Frank Welker' AND CAST(REPLACE(trim(T1.inflation_adjusted_gross, '$'), ',', '') AS REAL) * 1.0 / CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) * 1.0 < 2;
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
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;
[INST] Please write me a SQL statement that answers the following question: Describe the voice actors and villains in Cinderella. [/INST] [/INST]
SELECT T1.`voice-actor`, T2.villian FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Cinderella';
[INST] Please write me a SQL statement that answers the following question: Who is the voice actor of the hero in Lion King? [/INST] [/INST]
SELECT T1.`voice-actor` FROM `voice-actors` AS T1 INNER JOIN characters AS T2 ON T1.movie = T2.movie_title WHERE T2.movie_title = 'Lion King' AND T1.character = 'Lion King';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
SELECT T2.director, T1.MPAA_rating FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE T1.genre = 'Musical' AND SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) = '1993';
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
SELECT CAST(COUNT(CASE WHEN T1.genre = 'Comedy' THEN T1.movie_title ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_title), group_concat(T1.movie_title), group_concat(T2.director) FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3...
[INST] Here is a database schema: director : name [ TEXT ] primary_key director.name = characters.movie_title director [ TEXT ] movies_total_gross : movie_title [ TEXT ] movies_total_gross.movie_title = characters.movie_title release_date [ TEXT ] genre [ TEXT ] MPAA_rating [ TEXT ] total_gross [ TEXT ] inflation_adjus...
SELECT T2.name, T2.director FROM movies_total_gross AS T1 INNER JOIN director AS T2 ON T1.movie_title = T2.name WHERE SUBSTR(T1.release_date, LENGTH(T1.release_date) - 3, LENGTH(T1.release_date)) BETWEEN '2001' AND '2005' AND CAST(REPLACE(trim(T1.total_gross, '$'), ',', '') AS REAL) / ( SELECT SUM(CAST(REPLACE(trim(T3....
[INST] Please write me a SQL statement that answers the following question: Name the voice actor of the character Calliope in the movie Hercules. [/INST] [/INST]
SELECT `voice-actor` FROM `voice-actors` WHERE movie = 'Hercules' AND character = 'Calliope';