db_id
stringclasses 69
values | question
stringlengths 24
325
| evidence
stringlengths 0
673
| SQL
stringlengths 23
804
| question_id
int64 0
9.43k
| difficulty
stringclasses 1
value |
---|---|---|---|---|---|
movie_3 | List at least 10 films that falls into the Horror category. | film refers to title; Horror category refers to category.name = 'Horror' | 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' | 9,400 | |
movie_3 | Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors. | NC-17 rated refers to rating = 'NC-17' | 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' | 9,401 | |
movie_3 | Calculate the average rate of renting the film that Lucille Tracy got starred. | average rate = divide(sum(rental_rate), count(film_id)) | 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' | 9,402 | |
movie_3 | How many films have a duration between 100 to 110 minutes? | duration between 100 to 110 minutes refers to length between 100 and 110 | SELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110 | 9,403 | |
movie_3 | List down the actor ID of actors with Dee as their last name. | SELECT actor_id FROM actor WHERE last_name = 'Dee' | 9,404 | ||
movie_3 | Among the active customers, how many of them have Nina as their first name? | active refers to active = 1 | SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1 | 9,405 | |
movie_3 | In store ID 2, how many of the films are R rating?
| R rating refers to rating = 'R' | 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' | 9,406 | |
movie_3 | List the store ID of the films starred by Reese West with a duration of 100 minutes and below? | a duration of 100 minutes and below refers to length < 100 | 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' | 9,407 | |
movie_3 | Give the duration of the film starred by Nick Wahlberg with the highest rental rate. | duration refers to length; the highest rental rate refers to max(rental_rate) | 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 | 9,408 | |
movie_3 | What are the titles of the films starred by Russell Close? | 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' | 9,409 | ||
movie_3 | List the store ID of the film titled "Amadeus Holy". | 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' | 9,410 | ||
movie_3 | In films with a rental rate of 2.99, how many of the films are starred by Nina Soto? | a rental rate of 2.99 refers to rental_rate = 2.99 | 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' | 9,411 | |
movie_3 | 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? | result = subtract(count(film_id where store_id = 1), count(film_id where store_id = 2)) | 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' | 9,412 | |
movie_3 | What is the postal code of the address 692 Joliet Street? | SELECT postal_code FROM address WHERE address = '692 Joliet Street' | 9,413 | ||
movie_3 | How many customers are active? | active refers to active = 1 | SELECT COUNT(customer_id) FROM customer WHERE active = 1 | 9,414 | |
movie_3 | Among all the customers of store no.1, how many of them are active? | active refers to active = 1 | SELECT COUNT(customer_id) FROM customer WHERE active = 1 AND store_id = 1 | 9,415 | |
movie_3 | What is the address of Mary Smith? | 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' | 9,416 | ||
movie_3 | Among all the active customers, how many of them live in Arlington? | active refers to active = 1; Arlington refers to city = 'Arlington' | 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' | 9,417 | |
movie_3 | Please list the full names of all the customers who live in Italy. | full name refers to first_name, last_name; Italy refers to country = 'Italy' | SELECT T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy' | 9,418 | |
movie_3 | Which country does Mary Smith live in? | SELECT T3.country FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T4.first_name = 'MARY' AND T4.last_name = 'SMITH' | 9,419 | ||
movie_3 | What is the biggest amount of payment for a rental made by Mary Smith? | the biggest amount refers to max(amount) | SELECT T1.amount FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' ORDER BY T1.amount DESC LIMIT 1 | 9,420 | |
movie_3 | How many times has Mary Smith rented a film? | SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' | 9,421 | ||
movie_3 | What is the total amount of money Mary Smith has spent on film rentals? | the total amount = sum(amount) | SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' | 9,422 | |
movie_3 | Among the times Mary Smith had rented a movie, how many of them happened in June, 2005? | in June 2005 refers to year(payment_date) = 2005 and month(payment_date) = 6 | SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND STRFTIME('%Y',T1.payment_date) = '2005' AND STRFTIME('%Y', T1.payment_date) = '6' | 9,423 | |
movie_3 | Please give the full name of the customer who had made the biggest amount of payment in one single film rental. | full name refers to first_name, last_name; the biggest amount refers to max(amount) | SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.amount DESC LIMIT 1 | 9,424 | |
movie_3 | How much in total had the customers in Italy spent on film rentals? | total = sum(amount); Italy refers to country = 'Italy' | SELECT SUM(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy' | 9,425 | |
movie_3 | Among the payments made by Mary Smith, how many of them are over 4.99? | over 4.99 refers to amount > 4.99 | SELECT COUNT(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99 | 9,426 | |
movie_3 | What is the average amount of money spent by a customer in Italy on a single film rental? | Italy refers to country = 'Italy'; average amount = divide(sum(amount), count(customer_id)) where country = 'Italy' | SELECT AVG(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy' | 9,427 |