Chinastark/bird_dataset huggingface dataset:
Database: movie_3
Note: NC-17 rated refers to rating = 'NC-17';
Question: Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors.
SQL: SELECT 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 = 'NC-17'
Database: movie_3
Note: average rate = divide(sum(rental_rate), count(film_id));
Question: Calculate the average rate of renting the film that Lucille Tracy got starred.
SQL: SELECT avg(film.rental_rate) 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 = 'LUCILLE' AND actor.last_name = 'TRACY'
Database: movie_3
Note: duration between 100 to 110 minutes refers to length between 100 and 110;
Question: How many films have a duration between 100 to 110 minutes?
SQL: SELECT count(film_id) FROM film WHERE LENGTH BETWEEN 100 AND 110
Database: movie_3
Question: List down the actor ID of actors with Dee as their last name.
SQL: SELECT actor_id FROM actor WHERE last_name = 'Dee'
Database: movie_3
Note: active refers to active = 1;
Question: Among the active customers, how many of them have Nina as their first name?
SQL: SELECT count(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1
Database: movie_3
Note: R rating refers to rating = 'R';
Question: In store ID 2, how many of the films are R rating? 
SQL: SELECT count(film.film_id) FROM film INNER JOIN inventory ON film.film_id = inventory.film_id WHERE inventory.store_id = 2 AND film.rating = 'R'
Database: movie_3
Note: a duration of 100 minutes and below refers to length < 100;
Question: List the store ID of the films starred by Reese West with a duration of 100 minutes and below?
SQL: SELECT inventory.store_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 inventory ON film.film_id = inventory.film_id WHERE film.length < 100 AND actor.first_name = 'Reese' AND actor.last_name = 'West'
Database: movie_3
Note: duration refers to length; the highest rental rate refers to max(rental_rate);
Question: Give the duration of the film starred by Nick Wahlberg with the highest rental rate.
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 = 'Nick' AND actor.last_name = 'Wahlberg' ORDER BY film.rental_rate DESC LIMIT 1
Database: movie_3
Question: What are the titles of the films starred by Russell Close?
SQL: SELECT film.title FROM film_actor INNER JOIN actor ON film_actor.actor_id = actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE actor.first_name = 'Russell' AND actor.last_name = 'Close'
Database: movie_3
Question: List the store ID of the film titled "Amadeus Holy".
SQL: SELECT inventory.store_id FROM film INNER JOIN inventory ON film.film_id = inventory.film_id WHERE film.title = 'Amadeus Holy'
Database: movie_3
Note: a rental rate of 2.99 refers to rental_rate = 2.99;
Question: In films with a rental rate of 2.99, how many of the films are starred by Nina Soto?
SQL: SELECT count(film_actor.film_id) FROM film_actor INNER JOIN actor ON film_actor.actor_id = actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id WHERE film.rental_rate = 2.99 AND actor.first_name = 'Nina' AND actor.last_name = 'Soto'
Database: movie_3
Note: result = subtract(count(film_id where store_id = 1), count(film_id where store_id = 2));
Question: Among the films starred by Reese West, what is the difference between the films that have store ID of 1 and store ID of 2?
SQL: SELECT sum(iif(inventory.film_id = 1, 1, 0)) - sum(iif(inventory.film_id = 2, 1, 0)) AS diff FROM film_actor INNER JOIN actor ON film_actor.actor_id = actor.actor_id INNER JOIN film ON film_actor.film_id = film.film_id INNER JOIN inventory ON film.film_id = inventory.film_id WHERE actor.first_name = 'Reese' AND actor.last_name = 'West'
Database: movie_3
Question: What is the postal code of the address 692 Joliet Street?
SQL: SELECT postal_code FROM address WHERE address = '692 Joliet Street'
Database: movie_3
Note: active refers to active = 1;
Question: How many customers are active?
SQL: SELECT count(customer_id) FROM customer WHERE active = 1
Database: movie_3
Note: active refers to active = 1;
Question: Among all the customers of store no.1, how many of them are active?
SQL: SELECT count(customer_id) FROM customer WHERE active = 1 AND store_id = 1
Database: movie_3
Question: What is the address of Mary Smith?
SQL: SELECT address.address FROM address INNER JOIN customer ON address.address_id = customer.address_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH'
Database: movie_3
Note: active refers to active = 1; Arlington refers to city = 'Arlington';
Question: Among all the active customers, how many of them live in Arlington?
SQL: SELECT count(customer.customer_id) FROM address INNER JOIN customer ON address.address_id = customer.address_id INNER JOIN city ON address.city_id = city.city_id WHERE customer.active = 1 AND city.city = 'Arlington'
Database: movie_3
Note: full name refers to first_name, last_name; Italy refers to country = 'Italy';
Question: Please list the full names of all the customers who live in Italy.
SQL: SELECT customer.first_name, customer.last_name FROM address INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id INNER JOIN customer ON address.address_id = customer.address_id WHERE country.country = 'Italy'
Database: movie_3
Question: Which country does Mary Smith live in?
SQL: SELECT country.country FROM address INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id INNER JOIN customer ON address.address_id = customer.address_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH'
Database: movie_3
Note: the biggest amount refers to max(amount);
Question: What is the biggest amount of payment for a rental made by Mary Smith?
SQL: SELECT payment.amount FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH' ORDER BY payment.amount DESC LIMIT 1
Database: movie_3
Question: How many times has Mary Smith rented a film?
SQL: SELECT count(payment.customer_id) FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH'
Database: movie_3
Note: the total amount = sum(amount);
Question: What is the total amount of money Mary Smith has spent on film rentals?
SQL: SELECT sum(payment.amount) FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH'
Database: movie_3
Note: in June 2005 refers to year(payment_date) = 2005 and month(payment_date) = 6;
Question: Among the times Mary Smith had rented a movie, how many of them happened in June, 2005?
SQL: SELECT count(payment.customer_id) FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH' AND strftime('%Y',payment.payment_date) = '2005' AND strftime('%Y', payment.payment_date) = '6'
Database: movie_3
Note: full name refers to first_name, last_name; the biggest amount refers to max(amount);
Question: Please give the full name of the customer who had made the biggest amount of payment in one single film rental.
SQL: SELECT customer.first_name, customer.last_name FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id ORDER BY payment.amount DESC LIMIT 1
Database: movie_3
Note: total = sum(amount); Italy refers to country = 'Italy';
Question: How much in total had the customers in Italy spent on film rentals?
SQL: SELECT sum(payment.amount) FROM address INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id INNER JOIN customer ON address.address_id = customer.address_id INNER JOIN payment ON customer.customer_id = payment.customer_id WHERE country.country = 'Italy'
Database: movie_3
Note: over 4.99 refers to amount > 4.99;
Question: Among the payments made by Mary Smith, how many of them are over 4.99?
SQL: SELECT count(payment.amount) FROM payment INNER JOIN customer ON payment.customer_id = customer.customer_id WHERE customer.first_name = 'MARY' AND customer.last_name = 'SMITH' AND payment.amount > 4.99
Database: movie_3
Note: Italy refers to country = 'Italy'; average amount = divide(sum(amount), count(customer_id)) where country = 'Italy';
Question: What is the average amount of money spent by a customer in Italy on a single film rental?
SQL: SELECT avg(payment.amount) FROM address INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id INNER JOIN customer ON address.address_id = customer.address_id INNER JOIN payment ON customer.customer_id = payment.customer_id WHERE country.country = 'Italy'