Chinastark/bird_dataset huggingface dataset:
Database: movie_3
Question: To which country does the address '1386 Nakhon Sawan Boulevard' belong?
SQL: SELECT country.country FROM country INNER JOIN city ON country.country_id = city.country_id INNER JOIN address ON city.city_id = address.city_id WHERE address.address = '1386 Nakhon Sawan Boulevard'
Database: movie_3
Note: released in 2006 refers to release_year = 2006; the most used language refers to MAX(COUNT(language_id));
Question: What language was the most used in movies released in 2006?
SQL: SELECT t.language_id FROM ( SELECT film.language_id, count(film.language_id) AS num FROM film INNER JOIN LANGUAGE ON film.language_id = LANGUAGE.language_id WHERE strftime('%Y',film.release_year) = '2006' GROUP BY film.language_id ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: 'classics' is the name of category;
Question: Indicate the title of all the films that are in the Classics category.
SQL: SELECT film.title FROM film_category INNER JOIN film ON film_category.film_id = film.film_id INNER JOIN category ON film_category.category_id = category.category_id WHERE category.name = 'Classics'
Database: movie_3
Note: 'Ella Oliver' is a full name of a customer; full name refers to first_name, last_name; rental hired in June 2016 refers to rental_date BETWEEN '2005-06-01' AND '2005-06-30';
Question: How many rentals did Ella Oliver hire in June 2016?
SQL: SELECT count(rental.rental_id) FROM rental INNER JOIN customer ON rental.customer_id = customer.customer_id WHERE customer.first_name = 'ELLA' AND customer.last_name = 'ELLA' AND date(rental.rental_date) BETWEEN '2005-06-01' AND '2005-06-30'
Database: movie_3
Note: 'Jon Stephens' is a full name of a customer; full name refers to first_name, last_name;
Question: How many different clients have rented materials from Jon Stephens?
SQL: SELECT count(rental.customer_id) FROM rental INNER JOIN staff ON rental.staff_id = staff.staff_id WHERE staff.first_name = 'Jon' AND staff.last_name = 'Stephens'
Database: movie_3
Note: July 29, 2005 refers to rental_date like '2005-07-29';
Question: What is the total amount paid for rentals made on July 29, 2005?
SQL: SELECT sum(payment.amount) FROM rental INNER JOIN payment ON rental.rental_id = payment.rental_id WHERE date(rental.rental_date) = '2005-07-29%'
Database: movie_3
Note: postal code that begins with 76 refers to postal_code like '76%';
Question: What is the first name of the customers whose address is in the postal code that begins with 76?
SQL: SELECT customer.first_name FROM customer INNER JOIN address ON customer.address_id = address.address_id WHERE substr(address.postal_code, 1, 2) = '76'
Database: movie_3
Note: 'BLOOD ARGONAUTS' is a title of a film; date a movie was returned refers to return_date;
Question: On what date was the rented material for the movie BLOOD ARGONAUTS returned?
SQL: SELECT rental.rental_date FROM rental INNER JOIN inventory ON rental.inventory_id = inventory.inventory_id INNER JOIN film ON inventory.film_id = film.film_id WHERE film.title = 'BLOOD ARGONAUTS'
Database: movie_3
Note: 'Cuba Allen' is a full name of an actor; full name refers to first_name, last_name;
Question: What is the title of the films in which Cuba Allen acted?
SQL: SELECT film.title FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE actor.first_name = 'Cuba' AND actor.last_name = 'Allen'
Database: movie_3
Note: Music' is a name of a category;
Question: How many actors acted in movies in the Music category?
SQL: SELECT count(actor.actor_id) FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON film_category.category_id = category.category_id WHERE category.name = 'Music'
Database: movie_3
Note: full name refers to first_name, last_name; 'comedy' is a name of a category;
Question: What is the full name of the actor who has acted the most times in comedy films?
SQL: SELECT t.first_name, t.last_name FROM ( SELECT actor.first_name, actor.last_name, count(film_actor.actor_id) AS num FROM film_category INNER JOIN film_actor ON film_category.film_id = film_actor.film_id INNER JOIN category ON film_category.category_id = category.category_id INNER JOIN actor ON film_actor.actor_id = actor.actor_id WHERE category.name = 'Comedy' GROUP BY actor.first_name, actor.last_name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: not at Mike's store refers to staff.first_name ! = 'Mike';
Question: How many customers did not rent material at Mike's store?
SQL: SELECT count(customer.customer_id) FROM customer INNER JOIN store ON customer.store_id = store.store_id INNER JOIN staff ON store.manager_staff_id = staff.staff_id WHERE staff.first_name != 'Mike'
Database: movie_3
Note: name refers to first_name, last_name; Parents Strongly Precautioned' refers to rating = 'PG-13';  highest replacement cost refers to MAX(replacement_cost);
Question: Indicate the name of the actors of the films rated as 'Parents Strongly Precautioned' with the highest replacement cost.
SQL: SELECT actor.first_name, actor.last_name FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE film.rating = 'PG-13' ORDER BY film.replacement_cost DESC LIMIT 1
Database: movie_3
Note: name refers to first_name, last_name; without returning a rented material refers to return_date is null;
Question: What is the name of the client who has the largest quantity of rented material without returning it?
SQL: SELECT t.first_name FROM ( SELECT customer.first_name, count(rental.rental_date) AS num FROM rental INNER JOIN customer ON rental.customer_id = customer.customer_id GROUP BY customer.first_name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Question: How many customers live in the city of Miyakonojo?
SQL: SELECT count(customer.customer_id) FROM city INNER JOIN address ON city.city_id = address.city_id INNER JOIN customer ON address.address_id = customer.address_id WHERE city.city = 'Miyakonojo'
Database: movie_3
Note: non-active clients refers to active = 0; not returning a rented material refers to rental_date is null;
Question: How many non-active clients have not returned the rented material?
SQL: SELECT count(customer.customer_id) FROM rental INNER JOIN customer ON rental.customer_id = customer.customer_id WHERE customer.active = 0
Database: movie_3
Note: animated film means animation; animation is a name of a category;
Question: What is the title of the animated films that have the shortest length?
SQL: SELECT film.title FROM film INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON film_category.category_id = category.category_id ORDER BY film.length LIMIT 1
Database: movie_3
Note: 'Hector Poinexter' is a full name of a customer; full name refers to first_name, last_name;
Question: In which country is the store where Hector Poinexter rents equipment located?
SQL: SELECT country.country FROM customer INNER JOIN store ON customer.store_id = store.store_id INNER JOIN address ON store.address_id = address.address_id INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id WHERE customer.first_name = 'HECTOR' AND customer.last_name = 'POINDEXTER'
Database: movie_3
Note: 'Horror' is a name of a category; average rental payment refers to AVG(amount);
Question: What is the average rental payment in Horror movies?
SQL: SELECT avg(payment.amount) FROM category INNER JOIN film_category ON category.category_id = film_category.category_id INNER JOIN inventory ON film_category.film_id = inventory.film_id INNER JOIN rental ON inventory.inventory_id = rental.inventory_id INNER JOIN payment ON rental.rental_id = payment.rental_id WHERE category.name = 'Horror'
Database: movie_3
Note: 'Christy Vargas' is a full name of a customer; full name refers to first_name, last_name; average amount of rent refers to AVG(amount);
Question: What is the average amount of rent that Christy Vargas paid?
SQL: SELECT avg(payment.amount) FROM customer INNER JOIN payment ON customer.customer_id = payment.customer_id WHERE customer.first_name = 'CHRISTY' AND customer.last_name = 'VARGAS'
Database: movie_3
Note: Drama' is a name of a category; calculation = DIVIDE(SUM(length < 100 AND name = 'Drama'), COUNT(film_id)) * 100;
Question: What percentage of films with a length of less than 100 belong to the Drama category?
SQL: SELECT cast(sum(iif(film.length < 100 AND category.name = 'Drama', 1, 0)) AS REAL) * 100 / count(film_category.film_id) FROM film_category INNER JOIN film ON film_category.film_id = film.film_id INNER JOIN category ON film_category.category_id = category.category_id
Database: movie_3
Note: forename means first_name; full name refers to first_name, last_name;
Question: What are the actors that have the same forename as Johnny? Please include in your answer the full names of these actors.
SQL: SELECT first_name, last_name FROM actor WHERE first_name = 'Johnny'
Database: movie_3
Note: address numbers refers to address_id;
Question: What are the address numbers that are located in Gansu district?
SQL: SELECT address_id FROM address WHERE district = 'Gansu'
Database: movie_3
Note: types of film refers to the name of a category; IDs refers to category_id; latest update refers to last_update.;
Question: Please list three types of film along with their IDs and the latest update.
SQL: SELECT DISTINCT name, category_id, last_update FROM category LIMIT 3
Database: movie_3
Note: full name refers to first_name, last_name; inactive customers refers to active = 0;
Question: Please list the full names of any three inactive customers.
SQL: SELECT first_name, last_name FROM customer WHERE active = 0 LIMIT 3
Database: movie_3
Note: rental price per day refers to DIVIDE(rental_price, rental_duration); 'Airplane Sierra' is a title of a film;
Question: What is the rental price per day for Airplane Sierra?
SQL: SELECT rental_rate / rental_duration AS RESULT FROM film WHERE title = 'AIRPLANE SIERRA'
Database: movie_3
Note: store number 2 refers to store_id = 2; where is a store located refers to address, address2, district;
Question: Where is store number 2 located?
SQL: SELECT address.address, address.address2, address.district FROM address INNER JOIN store ON address.address_id = store.address_id WHERE store.store_id = 2
Database: movie_3
Question: Which city does the address 1623 Kingstown Drive belong to?
SQL: SELECT city.city FROM city INNER JOIN address ON address.city_id = city.city_id WHERE address.address = '1623 Kingstown Drive'
Database: movie_3
Note: Algeria is a country;
Question: Please name three cities that belong to Algeria.
SQL: SELECT city.city FROM country INNER JOIN city ON country.country_id = city.country_id WHERE country.country = 'Algeria'
Database: movie_3
Note: 'Agent Truman' is a title of a film; category refers to name;
Question: What is the category of the film Agent Truman?
SQL: SELECT category.name FROM film INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON film_category.category_id = category.category_id WHERE film.title = 'AGENT TRUMAN'
Database: movie_3
Note: action is a name of category;
Question: Please list the titles of any three action films.
SQL: SELECT film.title FROM film INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON film_category.category_id = category.category_id WHERE category.name = 'Action' LIMIT 3
Database: movie_3
Note: 'children' AND 'action' are names of a category; Calculation = SUBTRACT(AVG('children'), AVG('action'));
Question: What is the difference between the number of children's films and action films?
SQL: SELECT sum(iif(category.name = 'Children', 1, 0)) - sum(iif(category.name = 'Action', 1, 0)) AS diff FROM film_category INNER JOIN category ON film_category.category_id = category.category_id
Database: movie_3
Note: 'Maria Miller' is a name of a customer; full name refers to first_name, last_name;
Question: Which district does Maria Miller live in?
SQL: SELECT address.district FROM customer INNER JOIN address ON customer.address_id = address.address_id WHERE customer.first_name = 'Maria' AND customer.last_name = 'Miller'
Database: movie_3
Note: active refers to active = 1; '1795 Santiago de Compostela Way' is an address; Texas is a district; who refers to first_name, last_name;
Question: Who is the customer that is active and lives at 1795 Santiago de Compostela Way, Texas?
SQL: SELECT customer.first_name, customer.last_name FROM customer INNER JOIN address ON customer.address_id = address.address_id WHERE address.address = '1795 Santiago de Compostela Way' AND customer.active = 1
Database: movie_3
Note: English is a name of a language; duration of over 50 minutes refers to length > 50; cost of replacement are under 10.99 refers to replacement_cost < 10.99;
Question: How many English films have a duration of over 50 minutes and the cost of replacement are under 10.99?
SQL: SELECT count(film.film_id) FROM film INNER JOIN LANGUAGE ON film.language_id = LANGUAGE.language_id WHERE LANGUAGE.name = 'English' AND film.length > 50 AND film.replacement_cost < 10.99
Database: movie_3
Note: Who are the actors refers to full name; full name refers to first_name, last_name; 'ACADEMY DINOSAUR' is a title of a film;
Question: Who are the actors that act in the ACADEMY DINOSAUR film?
SQL: SELECT actor.first_name, actor.last_name FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE film.title = 'ACADEMY DINOSAUR'
Database: movie_3
Note: film refers to title of the film; 'Penelope Guiness' is a full name of an actor; full name refers to first_name, last_name;
Question: Please list any two films that Penelope Guiness acted in.
SQL: SELECT film.title FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE actor.first_name = 'Penelope' AND actor.last_name = 'Guiness' LIMIT 2
Database: movie_3
Note: documentary' is a name of a category; calculation = DIVIDE(SUM(name = 'Documentary'), COUNT(film_id)) * 100;
Question: What is the percentage of documentary films?
SQL: SELECT cast(sum(iif(category.name = 'Documentary', 1, 0)) AS REAL) * 100 / count(film_category.film_id) FROM film_category INNER JOIN category ON film_category.category_id = category.category_id
Database: movie_3
Note: English is a name of a language; for adults only refers to rating = 'NC-17';
Question: How many films in English are for adults only?
SQL: SELECT count(film.film_id) FROM film INNER JOIN LANGUAGE ON film.language_id = LANGUAGE.language_id WHERE LANGUAGE.name = 'English' AND film.rating = 'NC-17'
Database: movie_3
Note: film refers to the title; the longest duration refers to MAX(length);
Question: Which film has the longest duration?
SQL: SELECT title FROM film WHERE LENGTH = ( SELECT max(LENGTH) FROM film )
Database: movie_3
Note: 'Dan' is a first_name of an actor;
Question: How many of the actors are named "Dan"?
SQL: SELECT count(actor_id) FROM actor WHERE first_name = 'Dan'
Database: movie_3
Note: the most common first name refers to MAX(COUNT(first_name));
Question: What is the most common first name among the customers?
SQL: SELECT first_name FROM customer GROUP BY first_name ORDER BY count(first_name) DESC LIMIT 1
Database: movie_3
Note: film featuring behind the scenes refers to special_features = 'Behind the Scenes';
Question: What are the ratings of the film featuring behind the scenes?
SQL: SELECT rating FROM film WHERE special_features LIKE '%Behind the Scenes%'
Database: movie_3
Note: the largest number of films refers to MAX(rental_id);
Question: What is the largest number of films rented per customer?
SQL: SELECT count(rental_id) FROM rental GROUP BY customer_id ORDER BY count(rental_id) DESC LIMIT 1
Database: movie_3
Note: films refers to title;
Question: List all the films with the word "Lacklusture" in their description.
SQL: SELECT title FROM film_text WHERE description LIKE '%Lacklusture%'
Database: movie_3
Note: 'Francis Sikes' is a full name of a customer; full name refers to first_name, last_name;
Question: How many films did a customer named Francis Sikes rent?
SQL: SELECT count(customer.customer_id) FROM customer INNER JOIN rental ON customer.customer_id = rental.customer_id WHERE customer.first_name = 'FRANCIS' AND customer.last_name = 'SIKES'
Database: movie_3
Note: Who refers to first_name, last_name; the largest collection of films refers to MAX(film_id);
Question: Who is the manager of the store with the largest collection of films?
SQL: SELECT t.first_name, t.last_name FROM ( SELECT staff.first_name, staff.last_name, count(inventory.film_id) AS num FROM inventory INNER JOIN store ON inventory.store_id = store.store_id INNER JOIN staff ON store.manager_staff_id = staff.staff_id GROUP BY staff.first_name, staff.last_name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: inactive customers refers to active = 0;
Question: What are the addresses of the inactive customers?
SQL: SELECT address.address FROM customer INNER JOIN address ON customer.address_id = address.address_id WHERE customer.active = 0
Database: movie_3
Note: most common category refers to MAX(COUNT(category.name));
Question: Which category is the most common?
SQL: SELECT t.name FROM ( SELECT category.name, count(category.name) AS num FROM film_category INNER JOIN category ON film_category.category_id = category.category_id GROUP BY category.name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: 'Jason trap' is a title of a film; cast means actor; actor refers to first_name, last_name;
Question: Provide the cast for the film "Jason trap".
SQL: SELECT actor.first_name, actor.last_name FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE film.title = 'JASON TRAP'
Database: movie_3
Note: Who refers to first_name, last_name; the largest payment for rental refers to MAX(SUM(amount));
Question: Who is the customer with the largest payment for rental films?
SQL: SELECT t.first_name, t.last_name FROM ( SELECT customer.first_name, customer.last_name, sum(payment.amount) AS num FROM customer INNER JOIN payment ON customer.customer_id = payment.customer_id GROUP BY customer.first_name, customer.last_name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: film refers to title; most rented refers to MAX(inventory_id);
Question: List the top 5 most-rented films.
SQL: SELECT t.title FROM ( SELECT film.title, count(inventory.inventory_id) AS num FROM rental INNER JOIN inventory ON rental.inventory_id = inventory.inventory_id INNER JOIN film ON inventory.film_id = film.film_id GROUP BY film.title ) AS t ORDER BY t.num DESC LIMIT 5
Database: movie_3
Note: 'Sasebo' is a city;
Question: Which country does Sasebo belong to?
SQL: SELECT country.country FROM country INNER JOIN city ON country.country_id = city.country_id WHERE city.city = 'Sasebo'
Database: movie_3
Question: What are the addresses for the stores?
SQL: SELECT address.address FROM store INNER JOIN address ON store.address_id = address.address_id
Database: movie_3
Note: 'animation' is a name of a category;
Question: List all the animation titles.
SQL: SELECT film.title AS per FROM film_category INNER JOIN category ON film_category.category_id = category.category_id INNER JOIN film ON film_category.film_id = film.film_id WHERE category.name = 'Animation'
Database: movie_3
Note: the most customers refers to MAX(COUNT(customer_id));
Question: What is the city with the most customers?
SQL: SELECT t.city FROM ( SELECT city.city, count(customer.customer_id) AS num FROM city INNER JOIN address ON address.city_id = city.city_id INNER JOIN customer ON address.address_id = customer.address_id GROUP BY city.city ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: actor refers to first_name, last_name; the most film refers to MAX(SUM(film_id));
Question: Which actor acted in the most films?
SQL: SELECT t.first_name, t.last_name FROM ( SELECT actor.first_name, actor.last_name, sum(film_actor.film_id) AS num FROM film_actor INNER JOIN actor ON film_actor.actor_id = actor.actor_id GROUP BY actor.first_name, actor.last_name ) AS t ORDER BY t.num DESC LIMIT 1
Database: movie_3
Note: horror' is a name of a category; calculation = DIVIDE(SUM(name = 'Horror'), COUNT(film_id)) * 100;
Question: What percentage of films are horror films?
SQL: SELECT cast(sum(iif(category.name = 'Horror', 1, 0)) AS REAL) * 100 / count(film_category.film_id) FROM film_category INNER JOIN category ON film_category.category_id = category.category_id INNER JOIN film ON film_category.film_id = film.film_id
Database: movie_3
Note: full name refers to first_name, last_name;
Question: Please indicate the full name of actor id 5.
SQL: SELECT first_name, last_name FROM actor WHERE actor_id = 5
Database: movie_3
Note: id movies refers to film_id;
Question: How many id movies have category id 11?
SQL: SELECT count(film_id) FROM film_category WHERE category_id = 11
Database: movie_3
Note: category refers to name; BABY HALL film refers to title = 'BABY HALL';
Question: Which category does BABY HALL film belong to?
SQL: SELECT category.`name` FROM film INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON category.category_id = film_category.category_id WHERE film.title = 'BABY HALL'
Database: movie_3
Note: full name refers to first_name, last_name; the highest rental rate refers to max(rental_rate);
Question: Give the full name of the actor with the highest rental rate.
SQL: SELECT actor.first_name, actor.last_name FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film.film_id = film_actor.film_id ORDER BY film.rental_rate DESC LIMIT 1
Database: movie_3
Question: Please give the description of the movie starring JENNIFER DAVIS.
SQL: SELECT film.description FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id INNER JOIN film ON film.film_id = film_actor.film_id WHERE actor.first_name = 'JOHNNY' AND actor.last_name = 'DAVIS'
Database: movie_3
Note: full name refers to first_name, last_name; more than 10$ refers to amount > 10;
Question: List the full names of customers who have paid more than 10$.
SQL: SELECT customer.first_name, customer.last_name FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE payment.amount > 10
Database: movie_3
Question: Please provide the address of the customer whose first name is SUSAN with the postal code 77948.
SQL: SELECT address.address FROM address INNER JOIN customer ON address.address_id = customer.address_id WHERE customer.first_name = 'SUSAN' AND address.postal_code = 77948
Database: movie_3
Note: name refers to first_name, last_name;
Question: How many customers have an address in Abu Dhabi city? List those customer names.
SQL: SELECT count(city.city_id) FROM city INNER JOIN address ON city.city_id = address.city_id INNER JOIN customer ON address.address_id = customer.address_id WHERE city.city = 'Abu Dhabi'
Database: movie_3
Note: full name refers to first_name, last_name; 692 Joliet Street refers to address = '692 Joliet Street';
Question: Please provide the full name of the customer at 692 Joliet Street.
SQL: SELECT customer.first_name, customer.last_name FROM address INNER JOIN customer ON address.address_id = customer.address_id WHERE address.address = '692 Joliet Street'
Database: movie_3
Note: duration over 120 minutes refers to length > 120; action category refers to category.name = 'action';
Question: List movie titles with duration over 120 minutes that are in the action category.
SQL: SELECT film.title FROM film INNER JOIN film_category ON film.film_id = film_category.film_id INNER JOIN category ON category.category_id = film_category.category_id WHERE category.`name` = 'action' AND film.length > 120