problem
stringlengths 121
422
| db_id
stringclasses 69
values | solution
stringlengths 23
804
|
---|---|---|
Write SQL query to solve given problem: What are the issues of the complains of male clients and products from age 25 and below?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT DISTINCT T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.sex = 'Male' AND T1.age < 25 |
Write SQL query to solve given problem: Among the reviews from midwest region, what are the products that received 1 star?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT DISTINCT T3.Product FROM state AS T1 INNER JOIN district AS T2 ON T1.StateCode = T2.state_abbrev INNER JOIN reviews AS T3 ON T2.district_id = T3.district_id WHERE T1.Region = 'Midwest' AND T3.Stars = 1 |
Write SQL query to solve given problem: List the products involved in the complaints received on March 2017 via TOVA server.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT DISTINCT T2.Product FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T1.server = 'TOVA' AND T2.`Date received` LIKE '2017-03%' |
Write SQL query to solve given problem: What is the division of the review of 5 stars received on December 17, 2017 for the product Eagle National Mortgage?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT T1.division FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 AND T2.Date = '2017-12-17' AND T2.Product = 'Eagle National Mortgage' |
Write SQL query to solve given problem: In complaints about the credit card product, list the phone number of the oldest client.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT T1.phone FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T2.Product = 'Credit card' ORDER BY T1.age DESC LIMIT 1 |
Write SQL query to solve given problem: In complaints received in 2014, how many of them were submitted via call?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT COUNT(T2.`Complaint ID`) FROM callcenterlogs AS T1 INNER JOIN events AS T2 ON T1.`Complaint ID` = T2.`Complaint ID` WHERE T2.`Submitted via` = 'Phone' AND strftime('%Y', T1.`Date received`) = '2014' |
Write SQL query to solve given problem: List the product and its issues of the complains of clients with age greater than the 60% of average age of all clients.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT DISTINCT T2.Product, T2.Issue FROM client AS T1 INNER JOIN events AS T2 ON T1.client_id = T2.Client_ID WHERE T1.age * 100 > ( SELECT AVG(age) * 60 FROM client ) |
Write SQL query to solve given problem: In reviews of product with 5 stars, what is the percentage of the reviews coming from the division of East North Central?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | retail_complains | SELECT CAST(SUM(CASE WHEN T1.division = 'East North Central' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.division) FROM district AS T1 INNER JOIN reviews AS T2 ON T1.district_id = T2.district_id WHERE T2.Stars = 5 |
Write SQL query to solve given problem: Please list the names of the production company of the movie "Four Rooms".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Four Rooms' |
Write SQL query to solve given problem: How many production companies does the movie "Four Rooms" have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(CNAME) FROM ( SELECT T1.company_name AS CNAME FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Four Rooms' ) |
Write SQL query to solve given problem: Please list the titles of all the movie produced by production company "Universal Pictures".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Universal Pictures' |
Write SQL query to solve given problem: What is the title of the latest released movie produced by production company "Universal Pictures"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Universal Pictures' ORDER BY T3.release_date DESC LIMIT 1 |
Write SQL query to solve given problem: What is the name of the director of photography of the movie "Pirates of the Caribbean: At World's End"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Director of Photography' |
Write SQL query to solve given problem: What was the job of Dariusz Wolski in the movie "Pirates of the Caribbean: At World's End"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T3.person_name = 'Dariusz Wolski' |
Write SQL query to solve given problem: Please list the names of all the crew members of the movie "Pirates of the Caribbean: At World's End".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' |
Write SQL query to solve given problem: How many crew members worked as producer in the movie "Pirates of the Caribbean: At World's End"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T3.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Producer' |
Write SQL query to solve given problem: Please list the names of all the producers in the movie "Pirates of the Caribbean: At World's End".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title LIKE 'Pirates of the Caribbean: At World%s End' AND T2.job = 'Producer' |
Write SQL query to solve given problem: In how many movie does Dariusz Wolski work as the director of photography?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' |
Write SQL query to solve given problem: Among the movie in which Dariusz Wolski works as the director of photography, what is the title of the one with the highest average vote?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' ORDER BY T1.vote_average DESC LIMIT 1 |
Write SQL query to solve given problem: When was the release date of the latest movie in which Dariusz Wolski worked as a crew member?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.release_date FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' ORDER BY T1.release_date DESC LIMIT 1 |
Write SQL query to solve given problem: Among the movie in which Dariusz Wolski works as the director of photography, what is the percentage of those movie whose vote average is over 5.0?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(COUNT(CASE WHEN T1.vote_average > 5 THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T1.vote_average) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' |
Write SQL query to solve given problem: What is the average revenue of the movie in which Dariusz Wolski works as the director of photography?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(SUM(T1.revenue) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Dariusz Wolski' AND T2.job = 'Director of Photography' |
Write SQL query to solve given problem: Give the name of the movie with a revenue of 559852396.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT title FROM movie WHERE revenue = 559852396 |
Write SQL query to solve given problem: What was David Rubin's job in the movie "Days of Thunder"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.job FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'David Rubin' AND T1.title = 'Days of Thunder' |
Write SQL query to solve given problem: How many movies were directed by Michael Bay?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_crew AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Michael Bay' AND T2.job = 'Director' |
Write SQL query to solve given problem: Show the total number of keywords of the movie "I Hope They Serve Beer in Hell".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.keyword_id) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'I Hope They Serve Beer in Hell' |
Write SQL query to solve given problem: For the movie "Land of the Dead", who is its director?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Land of the Dead' AND T2.job = 'Director' |
Write SQL query to solve given problem: Tell the number of movies made by Paramount Animation.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Paramount Animation' |
Write SQL query to solve given problem: How many female characters are there in the movie "Spider-Man 3"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(*) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Spider-Man 3' AND T3.gender = 'Female' |
Write SQL query to solve given problem: Provide the most used keyword in the movies.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.keyword_name FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id GROUP BY T1.keyword_name ORDER BY COUNT(T1.keyword_name) DESC LIMIT 1 |
Write SQL query to solve given problem: How many producers does the movie "The Amityville Horror" have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.person_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Amityville Horror' AND T2.job = 'Producer' |
Write SQL query to solve given problem: What is the production company of the movie "Crazy Heart"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Crazy Heart' |
Write SQL query to solve given problem: Give the number of movies with "saving the world" as the keyword.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM keyword AS T1 INNER JOIN movie_keywords AS T2 ON T1.keyword_id = T2.keyword_id WHERE keyword_name = 'saving the world' |
Write SQL query to solve given problem: For all the movies which were produced by Cruel and Unusual Films, which one has the most popularity?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Cruel and Unusual Films' ORDER BY T3.popularity DESC LIMIT 1 |
Write SQL query to solve given problem: For the movie "Reign of Fire", which department was Marcia Ross in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T4.department_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id INNER JOIN department AS T4 ON T2.department_id = T4.department_id WHERE T3.person_name = 'Marcia Ross' AND T1.title = 'Reign of Fire' |
Write SQL query to solve given problem: Calculate the average budget of the movies directed by Jaume Collet-Serra.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(SUM(T1.budget) AS REAL) / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jaume Collet-Serra' AND T2.job = 'Director' |
Write SQL query to solve given problem: What is the percentage of male characters in the movie "Bride Wars"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) * 100 / COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Bride Wars' |
Write SQL query to solve given problem: What is the title of the movie that was made with the most money and resources?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT title FROM movie ORDER BY budget DESC LIMIT 1 |
Write SQL query to solve given problem: How many movies have made at least 1 Billion at the box office?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(movie_id) FROM movie WHERE revenue > 1000000000 |
Write SQL query to solve given problem: When was the first movie released?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT MIN(release_date) FROM movie WHERE movie_status = 'Released' |
Write SQL query to solve given problem: How many crew are named John Young?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(person_id) FROM person WHERE person_name = 'John Young' |
Write SQL query to solve given problem: Provide the title of the movie that is most-liked by a large number of people.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT title FROM movie ORDER BY popularity DESC LIMIT 1 |
Write SQL query to solve given problem: Who is the person associated with the crew id 1325273?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT person_name FROM person WHERE person_id = 1325273 |
Write SQL query to solve given problem: What is the name of the production company that made the most movies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id ORDER BY COUNT(T2.movie_id) DESC LIMIT 1 |
Write SQL query to solve given problem: Who played Captain Jack Sparrow in all of the Pirates of the Caribbean movies?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT DISTINCT T3.person_name FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T2.character_name = 'Captain Jack Sparrow' AND T1.title LIKE 'Pirates of the Caribbean%' |
Write SQL query to solve given problem: What is Walt Disney Pictures' most popular movie?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Walt Disney Pictures' ORDER BY T3.popularity DESC LIMIT 1 |
Write SQL query to solve given problem: How many movies did Universal Studios release?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id WHERE T1.company_name = 'Universal Studios' |
Write SQL query to solve given problem: Which production company produced the movie that made the most money at the box office?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id GROUP BY T1.company_id ORDER BY SUM(T3.revenue) DESC LIMIT 1 |
Write SQL query to solve given problem: How many female crews are in the movie "Mr. Smith Goes to Washington"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T3.gender) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Mr. Smith Goes to Washington' AND T3.gender = 'Female' |
Write SQL query to solve given problem: List the names of the production companies that made at least 200 movies.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id HAVING COUNT(T2.movie_id) > 200 |
Write SQL query to solve given problem: How many movies did Harrison Ford appear in total?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Harrison Ford' |
Write SQL query to solve given problem: What is the title of Jamie Foxx's most recent movie?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jamie Foxx' ORDER BY T1.release_date DESC LIMIT 1 |
Write SQL query to solve given problem: How many movies released in 1995 did Quentin Tarantino appear in?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Quentin Tarantino' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 1995 |
Write SQL query to solve given problem: What is the title of the first crime movie ever released?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Crime' ORDER BY T1.release_date LIMIT 1 |
Write SQL query to solve given problem: How many horror movies are there?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T1.movie_id) FROM movie_genres AS T1 INNER JOIN genre AS T2 ON T1.genre_id = T2.genre_id WHERE T2.genre_name = 'Horror' |
Write SQL query to solve given problem: List the person IDs of the second film editors in Movie No. 12.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT person_id FROM movie_crew WHERE movie_id = 12 AND job = 'Second Film Editor' |
Write SQL query to solve given problem: How many animators does Movie No. 129 have?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(movie_id) FROM movie_crew WHERE movie_id = 129 AND job = 'Animation' |
Write SQL query to solve given problem: In Movie No. 19, how many people are there in Department No. 7? Please give me their job.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(DISTINCT job) FROM movie_crew WHERE movie_id = 19 AND department_id = 7 |
Write SQL query to solve given problem: Write the person ID and character name of casts between order numbers 1 and 10 in Movie No. 285.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT person_id, character_name FROM movie_cast WHERE movie_id = 285 AND cast_order BETWEEN 1 AND 10 |
Write SQL query to solve given problem: How many times did Bob Peterson appear in the movie credits?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Bob Peterson' |
Write SQL query to solve given problem: Tally the movie ID and character name in the movie starring Jim Carrey.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.movie_id, T2.character_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T1.person_name = 'Jim Carrey' |
Write SQL query to solve given problem: Give the names of the female cast in Movie No. 1865.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN gender AS T3 ON T1.gender_id = T3.gender_id WHERE T1.movie_id = 1865 AND T3.gender = 'Female' |
Write SQL query to solve given problem: Write me the titles of the movies starring Jim Carrey.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Jim Carrey' |
Write SQL query to solve given problem: List the director's name of the movies released between 1/01/1916 and 12/31/1925.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.person_name FROM movie_cast AS T1 INNER JOIN person AS T2 ON T1.person_id = T2.person_id INNER JOIN movie AS T3 ON T1.movie_id = T3.movie_id INNER JOIN movie_crew AS T4 ON T1.movie_id = T4.movie_id WHERE T4.job = 'Director' AND T3.release_date BETWEEN '1916-01-01' AND '1925-12-31' |
Write SQL query to solve given problem: How many films released between 1/2/1990 and 12/30/2000 starred Uma Thurman?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T3.person_name = 'Uma Thurman' AND T1.release_date BETWEEN '1990-01-01' AND '2000-12-31' |
Write SQL query to solve given problem: Write the titles of horror films with a vote average of more than 7.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Horror' AND vote_average > 7 |
Write SQL query to solve given problem: Give the genre and popularity of movies whose revenue is at least 120,000,000 between 2012 and 2015.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name, T1.popularity FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.revenue > 120000000 AND T1.release_date BETWEEN '2012-01-01' AND '2015-12-31' |
Write SQL query to solve given problem: How many Indian movies between 1/2/1990 and 12/30/2003 have revenue of more than 75,000,000 and popularity of no less than 20?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT COUNT(T2.movie_id) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id WHERE T1.revenue > 75000000 AND T1.popularity >= 20 AND T1.release_date BETWEEN '1990-01-01' AND '2003-12-31' |
Write SQL query to solve given problem: What is the title of the highest-budget film to date? Please include the revenue and name the country.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title, T1.revenue, T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id ORDER BY T1.budget DESC LIMIT 1 |
Write SQL query to solve given problem: List the title of movies in Latin released between 1/01/1990 and 12/31/1995.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_languages AS T2 ON T1.movie_id = T2.movie_id INNER JOIN language AS T3 ON T2.language_id = T3.language_id WHERE T3.language_name = 'Latin' AND T1.release_date BETWEEN '1990-01-01' AND '1995-12-31' |
Write SQL query to solve given problem: What is the average revenue of American movies in 2006?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT AVG(T1.revenue) FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'United States of America' AND CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2006 |
Write SQL query to solve given problem: Calculate the 2016 gap between the average revenue for Indian and American films.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT AVG(CASE WHEN T3.COUNTry_name = 'United States of America' THEN T1.revenue END) - AVG(CASE WHEN T3.COUNTry_name = 'India' THEN T1.revenue END) AS CALCULATE FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE CAST(STRFTIME('%Y', T1.release_date) AS INT) = 2016 |
Write SQL query to solve given problem: What is the percentage of romance films among films produced in India in 2015?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Romance' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'India' AND T1.release_date BETWEEN '2015-01-01' AND '2015-12-31' |
Write SQL query to solve given problem: Which actor plays Optimus Prime?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT DISTINCT T1.person_name FROM person AS T1 INNER JOIN movie_cast AS T2 ON T1.person_id = T2.person_id WHERE T2.character_name = 'Optimus Prime (voice)' |
Write SQL query to solve given problem: What is the gender of the character 'USAF Master Sgt. Epps?'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.gender FROM movie_cast AS T1 INNER JOIN gender AS T2 ON T1.gender_id = T2.gender_id WHERE T1.character_name = 'USAF Master Sgt. Epps' |
Write SQL query to solve given problem: List all companies who worked in the movie 'Ultramarines: A Warhammer 40,000 Movie.'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.company_name FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T3.title = 'Ultramarines: A Warhammer 40,000 Movie' |
Write SQL query to solve given problem: Which movie did the company 'Radiant Film GmbH' work on?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.title FROM production_company AS T1 INNER JOIN movie_company AS T2 ON T1.company_id = T2.company_id INNER JOIN movie AS T3 ON T2.movie_id = T3.movie_id WHERE T1.company_name = 'Radiant Film GmbH' |
Write SQL query to solve given problem: What are the genres of Sky Captain and the World of Tomorrow?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.title = 'Sky Captain and the World of Tomorrow' |
Write SQL query to solve given problem: Write all the keywords belonging to the movie 'Sky Captain and the World of Tomorrow.'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T1.title = 'Sky Captain and the World of Tomorrow' |
Write SQL query to solve given problem: The movie 'Gojira ni-sen mireniamu' is from which country?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.COUNTry_name FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T1.title = 'Gojira ni-sen mireniamu' |
Write SQL query to solve given problem: Which movie has the keyword 'extremis?'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'extremis' |
Write SQL query to solve given problem: List 10 movie titles that were produced in France.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'France' LIMIT 10 |
Write SQL query to solve given problem: Who is the director for the movie 'Transformers?'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Transformers' AND T2.job = 'Director' |
Write SQL query to solve given problem: List 10 crews alongside their jobs who worked on the movie 'Mad Max: Fury Road.'. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.person_name FROM movie AS T1 INNER JOIN movie_crew AS T2 ON T1.movie_id = T2.movie_id INNER JOIN person AS T3 ON T2.person_id = T3.person_id WHERE T1.title = 'Mad Max: Fury Road' LIMIT 10 |
Write SQL query to solve given problem: What percentage of movies that came from Japan belong in the 'animation' genre?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(COUNT(CASE WHEN T4.genre_name = 'Animation' THEN T1.movie_id ELSE NULL END) AS REAL) * 100 / COUNT(T1.movie_id) FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN production_COUNTry AS T3 ON T1.movie_id = T3.movie_id INNER JOIN genre AS T4 ON T2.genre_id = T4.genre_id INNER JOIN COUNTry AS T5 ON T3.COUNTry_id = T5.COUNTry_id WHERE T5.COUNTry_name = 'Japan' |
Write SQL query to solve given problem: What is the ratio between male and female cast members of the movie 'Iron Man?' Count how many have unspecified genders.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT CAST(COUNT(CASE WHEN T3.gender = 'Male' THEN 1 ELSE NULL END) AS REAL) / COUNT(CASE WHEN T3.gender = 'Female' THEN 1 ELSE NULL END) AS RATIO , COUNT(CASE WHEN T3.gender = 'Unspecified' THEN 1 ELSE NULL END) AS UNGENDERS FROM movie AS T1 INNER JOIN movie_cast AS T2 ON T1.movie_id = T2.movie_id INNER JOIN gender AS T3 ON T2.gender_id = T3.gender_id WHERE T1.title = 'Iron Man' |
Write SQL query to solve given problem: List down five movie titles that were released before 2000.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT title FROM movie WHERE CAST(STRFTIME('%Y', release_date) AS INT) < 2000 LIMIT 5 |
Write SQL query to solve given problem: What is the keyword ID of the movie with the title of "Sin City"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.keyword_id FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'Sin City' |
Write SQL query to solve given problem: Look for the movie title with the keyword of "angel".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'angel' |
Write SQL query to solve given problem: Which keywords belong to the movie titles with the highest popularity?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.keyword_name FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id ORDER BY T1.popularity DESC LIMIT 1 |
Write SQL query to solve given problem: Provide the genre ID of the movie with the title of "The Dark Knight".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.genre_id FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title = 'The Dark Knight' |
Write SQL query to solve given problem: List down the movie titles within the genre of thriller.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T3.genre_name = 'Thriller' |
Write SQL query to solve given problem: Write down five rumoured movie titles within the genre of Drama.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.movie_status = 'Rumored' AND T3.genre_name = 'Drama' LIMIT 5 |
Write SQL query to solve given problem: What is the genre of the movie title with the lowest revenue generated?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id ORDER BY T1.revenue LIMIT 1 |
Write SQL query to solve given problem: State the genre of the movie title with a runtime of only 14 minutes.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id WHERE T1.runtime = 14 |
Write SQL query to solve given problem: What is the genre of the movie title which was well-received by the audiences but made the lowest revenue?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T2.genre_id = T3.genre_id ORDER BY T1.vote_average DESC, T1.revenue LIMIT 1 |
Write SQL query to solve given problem: Provide the genre of a movie title with a tagline of "A long time ago in a galaxy far, far away…".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T3.genre_name FROM movie AS T1 INNER JOIN movie_genres AS T2 ON T1.movie_id = T2.movie_id INNER JOIN genre AS T3 ON T3.genre_id = T2.genre_id WHERE T1.tagline = 'A long time ago in a galaxy far, far away...' |
Write SQL query to solve given problem: What is the country ID of the movie with the title of "Pirates of the Caribbean: Dead Man's Chest"?. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T2.COUNTry_id FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id WHERE T1.title LIKE 'Pirates of the Caribbean: Dead Man%s Chest' |
Write SQL query to solve given problem: List down the movie titles that were produced in Canada.. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT T1.title FROM movie AS T1 INNER JOIN production_COUNTry AS T2 ON T1.movie_id = T2.movie_id INNER JOIN COUNTry AS T3 ON T2.COUNTry_id = T3.COUNTry_id WHERE T3.COUNTry_name = 'Canada' |
Write SQL query to solve given problem: Accumulate the budget of the movie titles with the keyword of "video game".. Keep the solution inside sql tag ```sql [SQL-Query] ``` | movies_4 | SELECT SUM(T1.budget) FROM movie AS T1 INNER JOIN movie_keywords AS T2 ON T1.movie_id = T2.movie_id INNER JOIN keyword AS T3 ON T2.keyword_id = T3.keyword_id WHERE T3.keyword_name = 'video game' |
Subsets and Splits