db_id
stringclasses
69 values
question
stringlengths
24
325
evidence
stringlengths
1
673
SQL
stringlengths
23
804
schema
stringclasses
69 values
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
List down the actor ID of actors with Dee as their last name.
null
SELECT actor_id FROM actor WHERE last_name = 'Dee'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
What are the titles of the films starred by Russell Close?
null
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
List the store ID of the film titled "Amadeus Holy".
null
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
What is the postal code of the address 692 Joliet Street?
null
SELECT postal_code FROM address WHERE address = '692 Joliet Street'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
How many customers are active?
active refers to active = 1
SELECT COUNT(customer_id) FROM customer WHERE active = 1
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
What is the address of Mary Smith?
null
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
Which country does Mary Smith live in?
null
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
movie_3
How many times has Mary Smith rented a film?
null
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,
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'
database name:db_id movie_3 film_text table film_text Cols: film id dtype integer, title dtype text, description dtype text, actor table actor Cols: actor id dtype integer, first name dtype text, last name dtype text, last update dtype datetime, address table address Cols: address id dtype integer, address dtype text, address 2 dtype text, district dtype text, city_id dtype integer, postal code dtype text, phone dtype text, last update dtype datetime, category table category Cols: category id dtype integer, name dtype text, last update dtype datetime, city table city Cols: city id dtype integer, city dtype text, country id dtype integer, last update dtype datetime, country table country Cols: country id dtype integer, the name of the country dtype text, last update dtype datetime, customer table customer Cols: country id dtype integer, store id dtype integer, first name dtype text, last name dtype text, email dtype text, address id dtype integer, active dtype integer, create date dtype datetime, last update dtype datetime, film table film Cols: film id dtype integer, title dtype text, description dtype text, release year dtype text, language id dtype integer, original language id dtype integer, rental duration dtype integer, rental rate dtype real, length dtype integer, replacement cost dtype real, rating dtype text, special features dtype text, last update dtype datetime, film_actor table film_actor Cols: actor id dtype integer, film id dtype integer, last update dtype datetime, film_category table film_category Cols: film id dtype integer, category id dtype integer, last update dtype datetime, inventory table inventory Cols: inventory id dtype integer, film id dtype integer, store id dtype integer, last update dtype datetime, language table language Cols: language id dtype integer, name dtype text, last update dtype datetime, payment table payment Cols: payment id dtype integer, customer id dtype integer, staff id dtype integer, rental id dtype integer, amount dtype real, payment date dtype datetime, last update dtype datetime, rental table rental Cols: rental id dtype integer, rental date dtype datetime, inventory id dtype integer, customer id dtype integer, return date dtype datetime, staff id dtype integer, last update dtype datetime, staff table staff Cols: staff id dtype integer, first name dtype text, last name dtype text, address id dtype integer, picture of the staff dtype blob, email of the staff dtype text, store id dtype integer, active dtype integer, username dtype text, password dtype text, last update dtype datetime, store table store Cols: store id dtype integer, manager staff id dtype integer, address id dtype integer, last update dtype datetime,