problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: List all the animation titles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'
Write SQL query to solve given problem: What is the city with the most customers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1
Write SQL query to solve given problem: Which actor acted in the most films?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1
Write SQL query to solve given problem: What percentage of films are horror films?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT CAST(SUM(IIF(T2.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id
Write SQL query to solve given problem: Please indicate the full name of actor id 5.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT first_name, last_name FROM actor WHERE actor_id = 5
Write SQL query to solve given problem: How many id movies have category id 11?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(film_id) FROM film_category WHERE category_id = 11
Write SQL query to solve given problem: Which category does BABY HALL film belong to?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL'
Write SQL query to solve given problem: Give the full name of the actor with the highest rental rate.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id ORDER BY T3.rental_rate DESC LIMIT 1
Write SQL query to solve given problem: Please give the description of the movie starring JENNIFER DAVIS.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.description FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T1.first_name = 'JOHNNY' AND T1.last_name = 'DAVIS'
Write SQL query to solve given problem: List the full names of customers who have paid more than 10$.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10
Write SQL query to solve given problem: Please provide the address of the customer whose first name is SUSAN with the postal code 77948.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'SUSAN' AND T1.postal_code = 77948
Write SQL query to solve given problem: How many customers have an address in Abu Dhabi city? List those customer names.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.city_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Abu Dhabi'
Write SQL query to solve given problem: Please provide the full name of the customer at 692 Joliet Street.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T1.address = '692 Joliet Street'
Write SQL query to solve given problem: List movie titles with duration over 120 minutes that are in the action category.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.`name` = 'action' AND T1.length > 120
Write SQL query to solve given problem: Which actor acted in ANONYMOUS HUMAN?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T3.title = 'ANONYMOUS HUMAN'
Write SQL query to solve given problem: Which movie title has the lowest movie rental in the horror category?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Horror' ORDER BY T1.rental_rate LIMIT 1
Write SQL query to solve given problem: List the descriptions of movies under the category Travel.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Travel'
Write SQL query to solve given problem: Calculate the total payment amount of customers in Nagasaki district.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.district = 'Nagasaki'
Write SQL query to solve given problem: Calculate the percentage of total payment of MARGARET MOORE customers.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT CAST(SUM(IIF(T2.first_name = 'MARGARET' AND T2.last_name = 'MOORE', T1.amount, 0)) AS REAL) * 100 / SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id
Write SQL query to solve given problem: Calculate the percentage of movie titles with a screen length of more than 120 minutes that have a category of horror movies.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT CAST(SUM(IIF(T3.`name` = 'Horror', 1, 0)) * 100 / COUNT(T1.film_id) AS REAL) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.length > 120
Write SQL query to solve given problem: How many film titles were released in 2006?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(film_id) FROM film WHERE release_year = 2006
Write SQL query to solve given problem: List down film titles from id 1 to 10.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE film_id BETWEEN 1 AND 10
Write SQL query to solve given problem: List down all of the film IDs with highest rental duration.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film )
Write SQL query to solve given problem: Which film titles have the most expensive rental rate?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )
Write SQL query to solve given problem: List down all of the film titles that are rated for general audiences.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE rating = 'G'
Write SQL query to solve given problem: What is the language for film titled "CHILL LUCK"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.`name` FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'CHILL LUCK'
Write SQL query to solve given problem: What are the last updated date for English film titles that were released in 2006?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT DISTINCT T1.last_update FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'English' AND T1.release_year = 2006
Write SQL query to solve given problem: How many Italian film titles were special featured with deleted scenes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'Italian' AND T1.special_features = 'deleted scenes'
Write SQL query to solve given problem: How many animation film titles are rated for adults only?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.title) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'animation' AND T1.rating = 'NC-17'
Write SQL query to solve given problem: List down all ratings of action film titles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'action'
Write SQL query to solve given problem: List down all film IDs of comedy film titles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.film_id FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'comedy'
Write SQL query to solve given problem: State the documentary film titles with longest length.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'documentary' ORDER BY T1.length DESC LIMIT 1
Write SQL query to solve given problem: What is the category of film titled "BLADE POLISH"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BLADE POLISH'
Write SQL query to solve given problem: What is Mary Smith's rental ID?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'
Write SQL query to solve given problem: List down all of the customers' first name who were attended by staff with ID 1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1
Write SQL query to solve given problem: List down email address of customers who were attended by staff with ID 2.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT DISTINCT T1.email FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 2
Write SQL query to solve given problem: List down the actor IDs of film titled "BOUND CHEAPER".. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'
Write SQL query to solve given problem: What is the inventory ID of Karen Jackson?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.inventory_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'KAREN' AND T1.last_name = 'JACKSON'
Write SQL query to solve given problem: List down all film titles starred by Jane Jackman.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T3.first_name = 'JANE' AND T3.last_name = 'JACKMAN'
Write SQL query to solve given problem: Who are the actors of film titled "BIRD INDEPENDENCE"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.first_name, T3.last_name FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T1.title = 'BIRD INDEPENDENCE'
Write SQL query to solve given problem: Calculate the total rental rate for animation film titles.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT SUM(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Animation'
Write SQL query to solve given problem: What is the average rental rate of sci-fi film titles?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT AVG(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.`name` = 'Sci-Fi'
Write SQL query to solve given problem: What is the percentage of horror film titles in English film titles?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT CAST(SUM(IIF(T3.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN language AS T4 ON T2.language_id = T4.language_id WHERE T4.name = 'English'
Write SQL query to solve given problem: Among the adult films, how many of them have a rental duration of fewer than 4 days?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND rental_duration < 4
Write SQL query to solve given problem: What is the title of the restricted film, whose length is 71 minutes and whose replacement cost is $29.99?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE replacement_cost = 29.99 AND rating = 'R' AND length = 71
Write SQL query to solve given problem: Write down the email addresses of active customers who rented between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.email FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.rental_date BETWEEN '2005-5-25 07:37:47' AND '2005-5-26 10:06:49' AND T2.active = 1
Write SQL query to solve given problem: Compute the total payment made by Sarah Lewis for film rentals so far.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT SUM(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'
Write SQL query to solve given problem: From 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'
Write SQL query to solve given problem: Tally the full names of actors in the film "Alabama Devil.". Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ALABAMA DEVIL'
Write SQL query to solve given problem: Tell me the title of the film in which Sandra Kilmer is one of the actors.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'SANDRA' AND T2.last_name = 'KILMER'
Write SQL query to solve given problem: How many documentary films are rated PG-13?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' AND T1.rating = 'PG-13'
Write SQL query to solve given problem: Give me the title and category name of films whose price per day is more than $30. Please include their special features.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title, T3.name, T1.special_features FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration * T1.rental_rate > 30
Write SQL query to solve given problem: Name the cast members of the movie 'African Egg'.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'AFRICAN EGG'
Write SQL query to solve given problem: Identify the number of movies rented by Maria Miller.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller'
Write SQL query to solve given problem: Name the most recent movie rented by Dorothy Taylor.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1
Write SQL query to solve given problem: Determine the number of action movies available for rent.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T2.film_id) FROM category AS T1 INNER JOIN film_category AS T2 ON T1.category_id = T2.category_id WHERE T1.name = 'Action'
Write SQL query to solve given problem: Where can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'
Write SQL query to solve given problem: How long did Austin Cintron take to return the movie 'Destiny Saturday'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.rental_date - T2.return_date FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'AUSTIN' AND T4.title = 'DESTINY SATURDAY'
Write SQL query to solve given problem: Identify the number of movies that starred Nick Stallone.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id AND T2.first_name = 'NICK' AND T2.last_name = 'STALLONE'
Write SQL query to solve given problem: Name the movie with the highest rental revenue among the shortest films.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE length = ( SELECT MIN(length) FROM film ) ORDER BY rental_duration * rental_rate DESC LIMIT 1
Write SQL query to solve given problem: Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'
Write SQL query to solve given problem: What is the average replacement cost for the movies with a rental rate of 4.99?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT AVG(replacement_cost) FROM film WHERE rental_rate = 4.99
Write SQL query to solve given problem: What is the average rental rate for PG-13 rated movies?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT AVG(rental_rate) FROM film WHERE rating = 'PG-13'
Write SQL query to solve given problem: Indicate the percentage of inactive customers at store no.1.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT CAST(SUM(CASE WHEN active = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(customer_id) FROM customer WHERE store_id = 1
Write SQL query to solve given problem: For how long can you rent the movie 'Dirty Ace'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT rental_duration FROM film WHERE title = 'DIRTY ACE'
Write SQL query to solve given problem: Identify the full name of the customer, who has the following email address: [email protected].. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT first_name, last_name FROM customer WHERE email = '[email protected]'
Write SQL query to solve given problem: Provide the list of the longest movies. Arrange these titles in alphabetical order.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )
Write SQL query to solve given problem: How many film categories are there?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(DISTINCT category_id) FROM category
Write SQL query to solve given problem: How many titles did Mary Smith rent in 2005? Determine the percentage of titles rented in June 2005.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T2.rental_id) , CAST(SUM(IIF(STRFTIME('%m',T2.rental_date) = '7', 1, 0)) AS REAL) * 100 / COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller' AND STRFTIME('%Y',T2.rental_date) = '2005'
Write SQL query to solve given problem: How many customers are still active?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(customer_id) FROM customer WHERE active = 1
Write SQL query to solve given problem: List all the films that are rated as PG-13.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT title FROM film WHERE rating = 'PG-13'
Write SQL query to solve given problem: List at least 10 films that the customers can rent for more than 5 days.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T.title FROM ( SELECT T1.title, COUNT(T3.customer_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE T1.rental_duration > 5 GROUP BY T1.title ) AS T WHERE T.num > 10
Write SQL query to solve given problem: List all the cities that belong to United Arab Emirates.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'
Write SQL query to solve given problem: List at least 5 customers who paid greater than $10. Provide the full name of the customers.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10
Write SQL query to solve given problem: What films did Burt Dukakis got star in?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'BURT' AND T2.last_name = 'DUKAKIS'
Write SQL query to solve given problem: Provide the full name of all the actors of the film "Ending Crowds".. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ENDING CROWDS'
Write SQL query to solve given problem: Who are the actors starred in the film "Bound Cheaper"?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER'
Write SQL query to solve given problem: List all the films that Karl Berr starred in and rated as PG.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG'
Write SQL query to solve given problem: List at least 3 cities under the country of Philippines.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'
Write SQL query to solve given problem: What are the films that are least rented by the customers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T.title FROM ( SELECT T3.title, COUNT(T1.customer_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 1
Write SQL query to solve given problem: List all the description of the films starring Lucille Tracy?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.film_id FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'LUCILLE' AND T2.last_name = 'TRACY'
Write SQL query to solve given problem: Which category is the film "Beach Heartbreakers" falls into?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'BEACH HEARTBREAKERS'
Write SQL query to solve given problem: List at least 10 films that falls into the Horror category.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'
Write SQL query to solve given problem: Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'NC-17'
Write SQL query to solve given problem: Calculate the average rate of renting the film that Lucille Tracy got starred.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT AVG(T3.rental_rate) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'LUCILLE' AND T1.last_name = 'TRACY'
Write SQL query to solve given problem: How many films have a duration between 100 to 110 minutes?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110
Write SQL query to solve given problem: List down the actor ID of actors with Dee as their last name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT actor_id FROM actor WHERE last_name = 'Dee'
Write SQL query to solve given problem: Among the active customers, how many of them have Nina as their first name?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1
Write SQL query to solve given problem: In store ID 2, how many of the films are R rating? . Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2 AND T1.rating = 'R'
Write SQL query to solve given problem: List the store ID of the films starred by Reese West with a duration of 100 minutes and below?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T4.store_id FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T3.length < 100 AND T1.first_name = 'Reese' AND T1.last_name = 'West'
Write SQL query to solve given problem: Give the duration of the film starred by Nick Wahlberg with the highest rental rate.. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1
Write SQL query to solve given problem: What are the titles of the films starred by Russell Close?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'Russell' AND T2.last_name = 'Close'
Write SQL query to solve given problem: List the store ID of the film titled "Amadeus Holy".. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T2.store_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'Amadeus Holy'
Write SQL query to solve given problem: In films with a rental rate of 2.99, how many of the films are starred by Nina Soto?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate = 2.99 AND T2.first_name = 'Nina' AND T2.last_name = 'Soto'
Write SQL query to solve given problem: Among the films starred by Reese West, what is the difference between the films that have store ID of 1 and store ID of 2?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT SUM(IIF(T4.film_id = 1, 1, 0)) - SUM(IIF(T4.film_id = 2, 1, 0)) AS diff FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T2.first_name = 'Reese' AND T2.last_name = 'West'
Write SQL query to solve given problem: What is the postal code of the address 692 Joliet Street?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT postal_code FROM address WHERE address = '692 Joliet Street'
Write SQL query to solve given problem: How many customers are active?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(customer_id) FROM customer WHERE active = 1
Write SQL query to solve given problem: Among all the customers of store no.1, how many of them are active?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1
Write SQL query to solve given problem: What is the address of Mary Smith?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
Write SQL query to solve given problem: Among all the active customers, how many of them live in Arlington?. Keep the solution inside sql tag ```sql [SQL-Query] ```
movie_3
SELECT COUNT(T2.customer_id) FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.active = 1 AND T3.city = 'Arlington'