Chinastark/bird_dataset huggingface dataset:
Database: movie_3
Question: Name the movie with the highest rental revenue among the shortest films.
Evidence: movie name refers to title; the highest rental revenue refers to max(multiply(rental_duration, rental_rate)); the shortest film refers to min(length)
SQL: SELECT title FROM film WHERE length = ( SELECT MIN(length) FROM film ) ORDER BY rental_duration * rental_rate DESC LIMIT 1
Database: movie_3
Question: Calculate the total amount paid by Stephanie Mitchell for film rentals in June 2005.
Evidence: the total amount = sum(amount); in June 2005 refers to payment_date like '2005-06%'
SQL: 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'
Database: movie_3
Question: What is the average replacement cost for the movies with a rental rate of 4.99?
Evidence: a rental rate of 4.99 refers to rental_rate = 4.99; average replacement cost = avg(replacement_cost)
SQL: SELECT AVG(replacement_cost) FROM film WHERE rental_rate = 4.99
Database: movie_3
Question: What is the average rental rate for PG-13 rated movies?
Evidence: PG-13 rated movie refers to rating = 'PG-13'; average rental rate = avg(rental_rate)
SQL: SELECT AVG(rental_rate) FROM film WHERE rating = 'PG-13'
Database: movie_3
Question: Indicate the percentage of inactive customers at store no.1.
Evidence: 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
SQL: SELECT CAST(SUM(CASE WHEN active = 0 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(customer_id) FROM customer WHERE store_id = 1
Database: movie_3
Question: For how long can you rent the movie 'Dirty Ace'?
Evidence: length refers to rental_duration; 'Dirty Ace' refers to title = 'DIRTY ACE'
SQL: SELECT rental_duration FROM film WHERE title = 'DIRTY ACE'
Database: movie_3
Question: Identify the full name of the customer, who has the following email address: SHEILA.WELLS@sakilacustomer.org.
Evidence: full name refers to first_name, last_name
SQL: SELECT first_name, last_name FROM customer WHERE email = 'SHEILA.WELLS@sakilacustomer.org'
Database: movie_3
Question: Provide the list of the longest movies. Arrange these titles in alphabetical order.
Evidence: the longest refers to max(length)
SQL: SELECT title FROM film WHERE length = ( SELECT MAX(length) FROM film )
Database: movie_3
Question: How many film categories are there?
SQL: SELECT COUNT(DISTINCT category_id) FROM category
Database: movie_3
Question: How many titles did Mary Smith rent in 2005? Determine the percentage of titles rented in June 2005.
Evidence: 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%
SQL: 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'
Database: movie_3
Question: How many customers are still active?
Evidence: active refers to active = 1
SQL: SELECT COUNT(customer_id) FROM customer WHERE active = 1
Database: movie_3
Question: List all the films that are rated as PG-13.
Evidence: film refers to title; rated as PG-13 refers to rating = 'PG-13'
SQL: SELECT title FROM film WHERE rating = 'PG-13'
Database: movie_3
Question: List at least 10 films that the customers can rent for more than 5 days.
Evidence: film refers to title; rent for more than 5 days refers to rental_duration > 5
SQL: 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
Database: movie_3
Question: List all the cities that belong to United Arab Emirates.
Evidence: United Arab Emirates refers to country = 'United Arab Emirates'
SQL: SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'United Arab Emirates'
Database: movie_3
Question: List at least 5 customers who paid greater than $10. Provide the full name of the customers.
Evidence: full name refers to first_name, last_name; greater than $10 refers to amount > 10
SQL: 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
Database: movie_3
Question: What films did Burt Dukakis got star in?
Evidence: film refers to title
SQL: 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'
Database: movie_3
Question: Provide the full name of all the actors of the film "Ending Crowds".
Evidence: full name refers to first_name, last_name; film "Ending Crowds" refers to title = 'ENDING CROWDS'
SQL: 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'
Database: movie_3
Question: Who are the actors starred in the film "Bound Cheaper"?
Evidence: actor refers to first_name, last_name; film "Bound Cheaper" refers to title = 'BOUND CHEAPER'
SQL: 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'
Database: movie_3
Question: List all the films that Karl Berr starred in and rated as PG.
Evidence: film refers to title; rated as PG refers to rating = 'PG'
SQL: 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'
Database: movie_3
Question: List at least 3 cities under the country of Philippines.
SQL: SELECT T1.city FROM city AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE country = 'Philippines'
Database: movie_3
Question: What are the films that are least rented by the customers?
Evidence: film refers to title; least rented refers to count(min(customer_id))
SQL: 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
Database: movie_3
Question: List all the description of the films starring Lucille Tracy?
SQL: 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'
Database: movie_3
Question: Which category is the film "Beach Heartbreakers" falls into?
Evidence: category refers to name; film "Beach Heartbreakers" refers to title = 'BEACH HEARTBREAKERS'
SQL: 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'
Database: movie_3
Question: List at least 10 films that falls into the Horror category.
Evidence: film refers to title; Horror category refers to category.name = 'Horror'
SQL: SELECT T1.title FROM film AS T1 INNER JOIN film_category AS T2 ON T1.film_id = T2.film_id INNER JOIN category AS T3 ON T2.category_id = T3.category_id WHERE T3.name = 'Horror'
Database: movie_3
Question: Who among the actors starred in a NC-17 rated film? Provide only the last name of the actors.
Evidence: NC-17 rated refers to rating = 'NC-17'
SQL: SELECT T1.last_name FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T3.rating = 'NC-17'
Database: movie_3
Question: Calculate the average rate of renting the film that Lucille Tracy got starred.
Evidence: average rate = divide(sum(rental_rate), count(film_id))
SQL: SELECT AVG(T3.rental_rate) FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'LUCILLE' AND T1.last_name = 'TRACY'
Database: movie_3
Question: How many films have a duration between 100 to 110 minutes?
Evidence: duration between 100 to 110 minutes refers to length between 100 and 110
SQL: SELECT COUNT(film_id) FROM film WHERE length BETWEEN 100 AND 110
Database: movie_3
Question: Among the active customers, how many of them have Nina as their first name?
Evidence: active refers to active = 1
SQL: SELECT COUNT(customer_id) FROM customer WHERE first_name = 'Nina' AND active = 1
Database: movie_3
Question: In store ID 2, how many of the films are R rating?

Evidence: R rating refers to rating = 'R'
SQL: SELECT COUNT(T1.film_id) FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T2.store_id = 2 AND T1.rating = 'R'
Database: movie_3
Question: List the store ID of the films starred by Reese West with a duration of 100 minutes and below?
Evidence: a duration of 100 minutes and below refers to length < 100
SQL: SELECT T4.store_id FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T3.length < 100 AND T1.first_name = 'Reese' AND T1.last_name = 'West'
Database: movie_3
Question: Give the duration of the film starred by Nick Wahlberg with the highest rental rate.
Evidence: duration refers to length; the highest rental rate refers to max(rental_rate)
SQL: SELECT T3.title FROM actor AS T1 INNER JOIN film_actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T2.film_id = T3.film_id WHERE T1.first_name = 'Nick' AND T1.last_name = 'Wahlberg' ORDER BY T3.rental_rate DESC LIMIT 1
Database: movie_3
Question: What are the titles of the films starred by Russell Close?
SQL: SELECT T3.title FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T2.first_name = 'Russell' AND T2.last_name = 'Close'
Database: movie_3
Question: List the store ID of the film titled "Amadeus Holy".
SQL: SELECT T2.store_id FROM film AS T1 INNER JOIN inventory AS T2 ON T1.film_id = T2.film_id WHERE T1.title = 'Amadeus Holy'
Database: movie_3
Question: In films with a rental rate of 2.99, how many of the films are starred by Nina Soto?
Evidence: a rental rate of 2.99 refers to rental_rate = 2.99
SQL: SELECT COUNT(T1.film_id) FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id WHERE T3.rental_rate = 2.99 AND T2.first_name = 'Nina' AND T2.last_name = 'Soto'
Database: movie_3
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?
Evidence: result = subtract(count(film_id where store_id = 1), count(film_id where store_id = 2))
SQL: SELECT SUM(IIF(T4.film_id = 1, 1, 0)) - SUM(IIF(T4.film_id = 2, 1, 0)) AS diff FROM film_actor AS T1 INNER JOIN actor AS T2 ON T1.actor_id = T2.actor_id INNER JOIN film AS T3 ON T1.film_id = T3.film_id INNER JOIN inventory AS T4 ON T3.film_id = T4.film_id WHERE T2.first_name = 'Reese' AND T2.last_name = 'West'
Database: movie_3
Question: How many customers are active?
Evidence: active refers to active = 1
SQL: SELECT COUNT(customer_id) FROM customer WHERE active = 1
Database: movie_3
Question: Among all the customers of store no.1, how many of them are active?
Evidence: active refers to active = 1
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 T1.address FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
Database: movie_3
Question: Among all the active customers, how many of them live in Arlington?
Evidence: active refers to active = 1; Arlington refers to city = 'Arlington'
SQL: SELECT COUNT(T2.customer_id) FROM address AS T1 INNER JOIN customer AS T2 ON T1.address_id = T2.address_id INNER JOIN city AS T3 ON T1.city_id = T3.city_id WHERE T2.active = 1 AND T3.city = 'Arlington'
Database: movie_3
Question: Please list the full names of all the customers who live in Italy.
Evidence: full name refers to first_name, last_name; Italy refers to country = 'Italy'
SQL: SELECT T4.first_name, T4.last_name FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T3.country = 'Italy'
Database: movie_3
Question: Which country does Mary Smith live in?
SQL: SELECT T3.country FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id WHERE T4.first_name = 'MARY' AND T4.last_name = 'SMITH'
Database: movie_3
Question: What is the biggest amount of payment for a rental made by Mary Smith?
Evidence: the biggest amount refers to max(amount)
SQL: SELECT T1.amount FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' ORDER BY T1.amount DESC LIMIT 1
Database: movie_3
Question: How many times has Mary Smith rented a film?
SQL: SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
Database: movie_3
Question: What is the total amount of money Mary Smith has spent on film rentals?
Evidence: the total amount = sum(amount)
SQL: SELECT SUM(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH'
Database: movie_3
Question: Among the times Mary Smith had rented a movie, how many of them happened in June, 2005?
Evidence: in June 2005 refers to year(payment_date) = 2005 and month(payment_date) = 6
SQL: SELECT COUNT(T1.customer_id) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND STRFTIME('%Y',T1.payment_date) = '2005' AND STRFTIME('%Y', T1.payment_date) = '6'
Database: movie_3
Question: Please give the full name of the customer who had made the biggest amount of payment in one single film rental.
Evidence: full name refers to first_name, last_name; the biggest amount refers to max(amount)
SQL: SELECT T2.first_name, T2.last_name FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.amount DESC LIMIT 1
Database: movie_3
Question: How much in total had the customers in Italy spent on film rentals?
Evidence: total = sum(amount); Italy refers to country = 'Italy'
SQL: SELECT SUM(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'
Database: movie_3
Question: Among the payments made by Mary Smith, how many of them are over 4.99?
Evidence: over 4.99 refers to amount > 4.99
SQL: SELECT COUNT(T1.amount) FROM payment AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'MARY' AND T2.last_name = 'SMITH' AND T1.amount > 4.99
Database: movie_3
Question: What is the average amount of money spent by a customer in Italy on a single film rental?
Evidence: Italy refers to country = 'Italy'; average amount = divide(sum(amount), count(customer_id)) where country = 'Italy'
SQL: SELECT AVG(T5.amount) FROM address AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN country AS T3 ON T2.country_id = T3.country_id INNER JOIN customer AS T4 ON T1.address_id = T4.address_id INNER JOIN payment AS T5 ON T4.customer_id = T5.customer_id WHERE T3.country = 'Italy'