db_id
stringclasses
69 values
schema
stringclasses
69 values
m_schema
stringclasses
69 values
question
stringlengths
24
325
sql
stringlengths
23
804
evidence
stringlengths
0
673
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Please list any two films that Penelope Guiness acted in.
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 = 'Penelope' AND T1.last_name = 'Guiness' LIMIT 2
film refers to title of the film; 'Penelope Guiness' is a full name of an actor; full name refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the percentage of documentary films?
SELECT CAST(SUM(IIF(T2.name = 'Documentary', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id
documentary' is a name of a category; calculation = DIVIDE(SUM(name = 'Documentary'), COUNT(film_id)) * 100
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many films in English are for adults only?
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN language AS T2 ON T1.language_id = T2.language_id WHERE T2.name = 'English' AND T1.rating = 'NC-17'
English is a name of a language; for adults only refers to rating = 'NC-17'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which film has the longest duration?
SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )
film refers to the title; the longest duration refers to MAX(length)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many of the actors are named "Dan"?
SELECT COUNT(actor_id) FROM actor WHERE first_name = 'Dan'
'Dan' is a first_name of an actor
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the most common first name among the customers?
SELECT first_name FROM customer GROUP BY first_name ORDER BY COUNT(first_name) DESC LIMIT 1
the most common first name refers to MAX(COUNT(first_name))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What are the ratings of the film featuring behind the scenes?
SELECT rating FROM film WHERE special_features LIKE '%Behind the Scenes%'
film featuring behind the scenes refers to special_features = 'Behind the Scenes'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the largest number of films rented per customer?
SELECT COUNT(rental_id) FROM rental GROUP BY customer_id ORDER BY COUNT(rental_id) DESC LIMIT 1
the largest number of films refers to MAX(rental_id)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the films with the word "Lacklusture" in their description.
SELECT title FROM film_text WHERE description LIKE '%Lacklusture%'
films refers to title
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many films did a customer named Francis Sikes rent?
SELECT COUNT(T1.customer_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'FRANCIS' AND T1.last_name = 'SIKES'
'Francis Sikes' is a full name of a customer; full name refers to first_name, last_name;
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Who is the manager of the store with the largest collection of films?
SELECT T.first_name, T.last_name FROM ( SELECT T3.first_name, T3.last_name, COUNT(T1.film_id) AS num FROM inventory AS T1 INNER JOIN store AS T2 ON T1.store_id = T2.store_id INNER JOIN staff AS T3 ON T2.manager_staff_id = T3.staff_id GROUP BY T3.first_name, T3.last_name ) AS T ORDER BY T.num DESC LIMIT 1
Who refers to first_name, last_name; the largest collection of films refers to MAX(film_id)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What are the addresses of the inactive customers?
SELECT T2.address FROM customer AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id WHERE T1.active = 0
inactive customers refers to active = 0;
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which category is the most common?
SELECT T.name FROM ( SELECT T2.name, COUNT(T2.name) AS num FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T2.name ) AS T ORDER BY T.num DESC LIMIT 1
most common category refers to MAX(COUNT(category.name))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Provide the cast for the film "Jason trap".
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'JASON TRAP'
'Jason trap' is a title of a film; cast means actor; actor refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Who is the customer with the largest payment for rental films?
SELECT T.first_name, T.last_name FROM ( SELECT T1.first_name, T1.last_name, SUM(T2.amount) AS num FROM customer AS T1 INNER JOIN payment AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ) AS T ORDER BY T.num DESC LIMIT 1
Who refers to first_name, last_name; the largest payment for rental refers to MAX(SUM(amount))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List the top 5 most-rented films.
SELECT T.title FROM ( SELECT T3.title, COUNT(T2.inventory_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 5
film refers to title; most rented refers to MAX(inventory_id)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which country does Sasebo belong to?
SELECT T1.country FROM country AS T1 INNER JOIN city AS T2 ON T1.country_id = T2.country_id WHERE T2.city = 'Sasebo'
'Sasebo' is a city
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What are the addresses for the stores?
SELECT T2.address FROM store AS T1 INNER JOIN address AS T2 ON T1.address_id = T2.address_id
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the animation titles.
SELECT T3.title AS per FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.name = 'Animation'
'animation' is a name of a category
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the city with the most customers?
SELECT T.city FROM ( SELECT T1.city, COUNT(T3.customer_id) AS num FROM city AS T1 INNER JOIN address AS T2 ON T2.city_id = T1.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id GROUP BY T1.city ) AS T ORDER BY T.num DESC LIMIT 1
the most customers refers to MAX(COUNT(customer_id))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which actor acted in the most films?
SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, SUM(T1.film_id) AS num FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id GROUP BY T2.first_name, T2.last_name ) AS T ORDER BY T.num DESC LIMIT 1
actor refers to first_name, last_name; the most film refers to MAX(SUM(film_id))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What percentage of films are horror films?
SELECT CAST(SUM(IIF(T2.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN category AS T2 ON T1.category_id = T2.category_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id
horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Please indicate the full name of actor id 5.
SELECT first_name, last_name FROM actor WHERE actor_id = 5
full name refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many id movies have category id 11?
SELECT COUNT(film_id) FROM film_category WHERE category_id = 11
id movies refers to film_id
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which category does BABY HALL film belong to?
SELECT T3.`name` FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BABY HALL'
category refers to name; BABY HALL film refers to title = 'BABY HALL'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Give the full name of the actor with the highest rental rate.
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id ORDER BY T3.rental_rate DESC LIMIT 1
full name refers to first_name, last_name; the highest rental rate refers to max(rental_rate)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Please give the description of the movie starring JENNIFER DAVIS.
SELECT T3.description FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T1.first_name = 'JOHNNY' AND T1.last_name = 'DAVIS'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List the full names of customers who have paid more than 10$.
SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10
full name refers to first_name, last_name; more than 10$ refers to amount > 10
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Please provide the address of the customer whose first name is SUSAN with the postal code 77948.
SELECT T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'SUSAN' AND T1.postal_code = 77948
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many customers have an address in Abu Dhabi city? List those customer names.
SELECT COUNT(T1.city_id) FROM city AS T1 INNER JOIN address AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T2.address_id = T3.address_id WHERE T1.city = 'Abu Dhabi'
name refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Please provide the full name of the customer at 692 Joliet Street.
SELECT T2.first_name, T2.last_name FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T1.address = '692 Joliet Street'
full name refers to first_name, last_name; 692 Joliet Street refers to address = '692 Joliet Street'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List movie titles with duration over 120 minutes that are in the action category.
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.`name` = 'action' AND T1.length > 120
duration over 120 minutes refers to length > 120; action category refers to category.name = 'action'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which actor acted in ANONYMOUS HUMAN?
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T3.film_id = T2.film_id WHERE T3.title = 'ANONYMOUS HUMAN'
actor refers to first_name, last_name; ANONYMOUS HUMAN refers to title = 'ANONYMOUS HUMAN'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which movie title has the lowest movie rental in the horror category?
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Horror' ORDER BY T1.rental_rate LIMIT 1
the lowest movie rental refers to min(rental_rate); the horror category refers to category.name = 'Horror'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List the descriptions of movies under the category Travel.
SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Travel'
the category Travel refers to category.name = 'Travel'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Calculate the total payment amount of customers in Nagasaki district.
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.district = 'Nagasaki'
the total payment amount refers to sum(amount)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Calculate the percentage of total payment of MARGARET MOORE customers.
SELECT CAST(SUM(IIF(T2.first_name = 'MARGARET' AND T2.last_name = 'MOORE', T1.amount, 0)) AS REAL) * 100 / SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id
percentage = divide(sum(amount where first_name = 'MARGARET' and last_name = 'MOORE'), sum(amount)) * 100%
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Calculate the percentage of movie titles with a screen length of more than 120 minutes that have a category of horror movies.
SELECT CAST(SUM(IIF(T3.`name` = 'Horror', 1, 0)) * 100 / COUNT(T1.film_id) AS REAL) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.length > 120
screen length of more than 120 minutes refers to length > 120; category of horror refers to category.name = 'Horror'; percentage = divide(count(title where length > 120 and category.name = 'Horror'), count(title)) * 100%
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many film titles were released in 2006?
SELECT COUNT(film_id) FROM film WHERE release_year = 2006
released in 2006 refers to release_year = 2006
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down film titles from id 1 to 10.
SELECT title FROM film WHERE film_id BETWEEN 1 AND 10
id 1 to 10 refers to film_id BETWEEN 1 and 10
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all of the film IDs with highest rental duration.
SELECT film_id FROM film WHERE rental_duration = ( SELECT MAX(rental_duration) FROM film )
highest rental duration refers to max(rental_duration)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which film titles have the most expensive rental rate?
SELECT title FROM film WHERE rental_rate = ( SELECT MAX(rental_rate) FROM film )
the most expensive rental rate refers to max(rental_rate)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all of the film titles that are rated for general audiences.
SELECT title FROM film WHERE rating = 'G'
rated for general audiences means rating = 'G'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the language for film titled "CHILL LUCK"?
SELECT T2.`name` FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'CHILL LUCK'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What are the last updated date for English film titles that were released in 2006?
SELECT DISTINCT T1.last_update FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'English' AND T1.release_year = 2006
the last updated date refers to last_update; English is name of language; released in 2006 refers to release_year = 2006
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many Italian film titles were special featured with deleted scenes?
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN `language` AS T2 ON T1.language_id = T2.language_id WHERE T2.`name` = 'Italian' AND T1.special_features = 'deleted scenes'
Italian is name of language; special featured with deleted scenes refers to special_features = 'deleted scenes'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many animation film titles are rated for adults only?
SELECT COUNT(T1.title) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'animation' AND T1.rating = 'NC-17'
animation film refers to category.name = 'animation'; for adults only means rating = 'NC-17'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all ratings of action film titles.
SELECT T1.description FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'action'
for General Audiences means rating = 'G'; Parental Guidance Suggested means rating = 'PG'; Parents Strongly Cautioned means rating = 'PG-13'; Restricted means rating = 'R'; Adults Only means rating = 'NC-17'; action film refers to category.name = 'action'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all film IDs of comedy film titles.
SELECT T1.film_id FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'comedy'
comedy is name of category
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
State the documentary film titles with longest length.
SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.name = 'documentary' ORDER BY T1.length DESC LIMIT 1
documentary film refers to name = 'documentary'; longest length refers to max(length)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the category of film titled "BLADE POLISH"?
SELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T1.title = 'BLADE POLISH'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is Mary Smith's rental ID?
SELECT T2.rental_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'MARY' AND T1.last_name = 'SMITH'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all of the customers' first name who were attended by staff with ID 1.
SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 1
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down email address of customers who were attended by staff with ID 2.
SELECT DISTINCT T1.email FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T2.staff_id = 2
email address refers to email
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down the actor IDs of film titled "BOUND CHEAPER".
SELECT T2.actor_id FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'BOUND CHEAPER'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the inventory ID of Karen Jackson?
SELECT T2.inventory_id FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'KAREN' AND T1.last_name = 'JACKSON'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List down all film titles starred by Jane Jackman.
SELECT T1.title FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T3.first_name = 'JANE' AND T3.last_name = 'JACKMAN'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Who are the actors of film titled "BIRD INDEPENDENCE"?
SELECT T3.first_name, T3.last_name FROM film AS T1 INNER JOIN film_actor AS T2 ON T1.film_id = T2.film_id INNER JOIN actor AS T3 ON T2.actor_id = T3.actor_id WHERE T1.title = 'BIRD INDEPENDENCE'
actor refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Calculate the total rental rate for animation film titles.
SELECT SUM(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.`name` = 'Animation'
animation film refers to category.name = 'Animation'; total rental rate = sum(rental_rate)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the average rental rate of sci-fi film titles?
SELECT AVG(T1.rental_rate) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T3.category_id = T2.category_id WHERE T3.`name` = 'Sci-Fi'
sci-fi film refers to category.name = 'Sci-Fi'; average rental rate = avg(rental_rate)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the percentage of horror film titles in English film titles?
SELECT CAST(SUM(IIF(T3.name = 'Horror', 1, 0)) AS REAL) * 100 / COUNT(T1.film_id) FROM film_category AS T1 INNER JOIN film AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T1.category_id = T3.category_id INNER JOIN language AS T4 ON T2.language_id = T4.language_id WHERE T4.name = 'English'
horror film refers to category.name = 'Horror'; English film refers to language.name = 'English'; percentage = divide(count(film_id where category.name = 'Horror'), count(film_id)) where language.name = 'English' * 100%
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Among the adult films, how many of them have a rental duration of fewer than 4 days?
SELECT COUNT(film_id) FROM film WHERE rating = 'NC-17' AND rental_duration < 4
adult film refers to rating = 'NC-17'; rental duration of fewer than 4 days refers to rental_duration < 4
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the title of the restricted film, whose length is 71 minutes and whose replacement cost is $29.99?
SELECT title FROM film WHERE replacement_cost = 29.99 AND rating = 'R' AND length = 71
restricted means rating = 'R'; length is 71 minutes refers to length = 71; replacement cost is $29.99 refers to replacement_cost = 29.99
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Write down the email addresses of active customers who rented between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM.
SELECT T2.email FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.rental_date BETWEEN '2005-5-25 07:37:47' AND '2005-5-26 10:06:49' AND T2.active = 1
email address refers to email; active refers to active = 1; between 5/25/2005 at 7:37:47 PM and 5/26/2005 at 10:06:49 AM refers to rental_date between '2005-5-25 07:37:47' and '2005-5-26 10:06:49'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Compute the total payment made by Sarah Lewis for film rentals so far.
SELECT SUM(T3.amount) FROM rental AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN payment AS T3 ON T1.rental_id = T3.rental_id WHERE T2.first_name = 'SARAH' AND T2.last_name = 'LEWIS'
total payment = sum(amount)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
From 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM, how many times did Susan Wilson pay for film rentals?
SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_date BETWEEN '2005-05-30 03:43:54' AND '2005-07-31 10:08:29'
from 5/30/2005 at 3:43:54 AM to 7/31/2005 at 10:08:29 PM refers to payment_date between '2005-05-30 03:43:54' and '2005-07-31 10:08:29'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Tally the full names of actors in the film "Alabama Devil."
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ALABAMA DEVIL'
full name refers to first_name, last_name; "Alabama Devil" refers to title = 'ALABAMA DEVIL'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Tell me the title of the film in which Sandra Kilmer is one of the actors.
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'SANDRA' AND T2.last_name = 'KILMER'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many documentary films are rated PG-13?
SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Documentary' AND T1.rating = 'PG-13'
documentary film refers to category.name = 'documentary'; rated PG-13 refers to rating = 'PG-13'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Give me the title and category name of films whose price per day is more than $30. Please include their special features.
SELECT T1.title, T3.name, T1.special_features FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.rental_duration * T1.rental_rate > 30
category name refers to category.name; price per day is more than $30 refers to multiply(rental_duration, rental_rate) > 30
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Name the cast members of the movie 'African Egg'.
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'AFRICAN EGG'
cast member name refers to first_name, last_name; 'African Egg' refers to title = 'AFRICAN EGG'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Identify the number of movies rented by Maria Miller.
SELECT COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Name the most recent movie rented by Dorothy Taylor.
SELECT T4.title FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'DOROTHY' AND T1.last_name = 'TAYLOR' ORDER BY T2.rental_date DESC LIMIT 1
movie name refers to title; the most recent refers to max(rental_date)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Determine the number of action movies available for rent.
SELECT COUNT(T2.film_id) FROM category AS T1 INNER JOIN film_category AS T2 ON T1.category_id = T2.category_id WHERE T1.name = 'Action'
action movie refers to category.name = 'Action'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Where can you rent the movie 'Wyoming Storm'? Identify the address of the rental store and the rental rate.
SELECT T2.store_id, T1.address, T4.rental_rate FROM address AS T1 INNER JOIN store AS T2 ON T1.address_id = T2.address_id INNER JOIN inventory AS T3 ON T2.store_id = T3.store_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T4.title = 'WYOMING STORM'
'Wyoming Storm' refers to title = 'WYOMING STORM'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How long did Austin Cintron take to return the movie 'Destiny Saturday'?
SELECT T2.rental_date - T2.return_date FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id INNER JOIN inventory AS T3 ON T2.inventory_id = T3.inventory_id INNER JOIN film AS T4 ON T3.film_id = T4.film_id WHERE T1.first_name = 'AUSTIN' AND T4.title = 'DESTINY SATURDAY'
'Destiny Saturday' refers to title = 'DESTINY SATURDAY'; length = subtract(return_date, rental_date)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Identify the number of movies that starred Nick Stallone.
SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id AND T2.first_name = 'NICK' AND T2.last_name = 'STALLONE'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Name the movie with the highest rental revenue among the shortest films.
SELECT title FROM film WHERE length = ( SELECT MIN(length) FROM film ) ORDER BY rental_duration * rental_rate DESC LIMIT 1
movie name refers to title; the highest rental revenue refers to max(multiply(rental_duration, rental_rate)); the shortest film refers to min(length)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.
SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'STEPHANIE' AND T2.last_name = 'MITCHELL' AND SUBSTR(T1.payment_date, 1, 7) = '2005-06'
the total amount = sum(amount); in June 2005 refers to payment_date like '2005-06%'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the average replacement cost for the movies with a rental rate of 4.99?
SELECT AVG(replacement_cost) FROM film WHERE rental_rate = 4.99
a rental rate of 4.99 refers to rental_rate = 4.99; average replacement cost = avg(replacement_cost)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What is the average rental rate for PG-13 rated movies?
SELECT AVG(rental_rate) FROM film WHERE rating = 'PG-13'
PG-13 rated movie refers to rating = 'PG-13'; average rental rate = avg(rental_rate)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Indicate the percentage of inactive customers at store no.1.
SELECT CAST(SUM(CASE WHEN active = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(customer_id) FROM customer WHERE store_id = 1
inactive refers to active = 0; store no.1 refers to store_id = 1; percentage = divide(count(customer_id where active = 0), count(customer_id)) * 100% where store_id = 1
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
For how long can you rent the movie 'Dirty Ace'?
SELECT rental_duration FROM film WHERE title = 'DIRTY ACE'
length refers to rental_duration; 'Dirty Ace' refers to title = 'DIRTY ACE'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Identify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org.
SELECT first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'
full name refers to first_name, last_name
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Provide the list of the longest movies. Arrange these titles in alphabetical order.
SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )
the longest refers to max(length)
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many film categories are there?
SELECT COUNT(DISTINCT category_id) FROM category
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many titles did Mary Smith rent in 2005? Determine the percentage of titles rented in June 2005.
SELECT COUNT(T2.rental_id) , CAST(SUM(IIF(STRFTIME('%m',T2.rental_date) = '7', 1, 0)) AS REAL) * 100 / COUNT(T2.rental_id) FROM customer AS T1 INNER JOIN rental AS T2 ON T1.customer_id = T2.customer_id WHERE T1.first_name = 'Maria' AND T1.last_name = 'Miller' AND STRFTIME('%Y',T2.rental_date) = '2005'
in June 2005 refers to month(rental_date) = 6 and year(rental_date) = 2005; percentage = divide(count(inventory_id where month(rental_date) = 6 and year(rental_date) = 2005), count(inventory_id)) * 100%
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
How many customers are still active?
SELECT COUNT(customer_id) FROM customer WHERE active = 1
active refers to active = 1
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the films that are rated as PG-13.
SELECT title FROM film WHERE rating = 'PG-13'
film refers to title; rated as PG-13 refers to rating = 'PG-13'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List at least 10 films that the customers can rent for more than 5 days.
SELECT T.title FROM ( SELECT T1.title, COUNT(T3.customer_id) AS num FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id INNER JOIN rental AS T3 ON T2.inventory_id = T3.inventory_id WHERE T1.rental_duration > 5 GROUP BY T1.title ) AS T WHERE T.num > 10
film refers to title; rent for more than 5 days refers to rental_duration > 5
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the cities that belong to United Arab Emirates.
SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'
United Arab Emirates refers to country = 'United Arab Emirates'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List at least 5 customers who paid greater than $10. Provide the full name of the customers.
SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T1.amount > 10
full name refers to first_name, last_name; greater than $10 refers to amount > 10
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What films did Burt Dukakis got star in?
SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'BURT' AND T2.last_name = 'DUKAKIS'
film refers to title
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Provide the full name of all the actors of the film "Ending Crowds".
SELECT T2.first_name, T2.last_name FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.title = 'ENDING CROWDS'
full name refers to first_name, last_name; film "Ending Crowds" refers to title = 'ENDING CROWDS'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Who are the actors starred in the film "Bound Cheaper"?
SELECT T1.first_name, T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.title = 'BOUND CHEAPER'
actor refers to first_name, last_name; film "Bound Cheaper" refers to title = 'BOUND CHEAPER'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the films that Karl Berr starred in and rated as PG.
SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'KARL' AND T1.last_name = 'BERRY' AND T3.rating = 'PG'
film refers to title; rated as PG refers to rating = 'PG'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List at least 3 cities under the country of Philippines.
SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
What are the films that are least rented by the customers?
SELECT T.title FROM ( SELECT T3.title, COUNT(T1.customer_id) AS num FROM rental AS T1 INNER JOIN inventory AS T2 ON T1.inventory_id = T2.inventory_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id GROUP BY T3.title ) AS T ORDER BY T.num DESC LIMIT 1
film refers to title; least rented refers to count(min(customer_id))
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
List all the description of the films starring Lucille Tracy?
SELECT T1.film_id FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id WHERE T2.first_name = 'LUCILLE' AND T2.last_name = 'TRACY'
movie_3
CREATE TABLE film_text ( film_id INTEGER not null primary key, title TEXT not null, description TEXT null ); CREATE TABLE "actor" ( actor_id INTEGER primary key autoincrement, first_name TEXT not null, last_name TEXT ...
【DB_ID】 movie_3 【Schema】 # Table: main.actor [ (actor_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (first_name:TEXT, Examples: [PENELOPE, NICK, ED]), (last_name:TEXT, Examples: [GUINESS, WAHLBERG, CHASE]), (last_update:DATETIME) ] # Table: main.address [ (address_id:INTEGER, Primary Key, Examples: [1, 2, 3]), (addres...
Which category is the film "Beach Heartbreakers" falls into?
SELECT T3.name FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T1.title = 'BEACH HEARTBREAKERS'
category refers to name; film "Beach Heartbreakers" refers to title = 'BEACH HEARTBREAKERS'