aherntech/sparc huggingface dataset:
Database: sakila_1
Question sequence:
What is the length of the film titled AIRPORT POLLOCK?
How about its rental duration?
And which language does the film AIRPORT POLLOCK use? List the language name.
SQL query sequence:
SELECT length FROM film WHERE title  =  'AIRPORT POLLOCK'
SELECT rental_duration FROM film WHERE title  =  'AIRPORT POLLOCK'
SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  'AIRPORT POLLOCK'
Final question: Which language does the film AIRPORT POLLOCK use? List the language name.
Final SQL: SELECT T2.name FROM film AS T1 JOIN LANGUAGE AS T2 ON T1.language_id  =  T2.language_id WHERE T1.title  =  'AIRPORT POLLOCK'
Database: sakila_1
Question sequence:
Tell me the movies in which the actor named ZERO played a role in.
What are the special features of this film?
Which movies have 'Deleted Scenes' as a substring in the special feature?
SQL query sequence:
SELECT T2.title FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T3.first_name = "ZERO"
SELECT T2.special_features FROM film_actor AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN actor AS T3 ON T1.actor_id = T3.actor_id WHERE T3.first_name = "ZERO"
SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
Final question: Which movies have 'Deleted Scenes' as a substring in the special feature?
Final SQL: SELECT title FROM film WHERE special_features LIKE '%Deleted Scenes%'
Database: sakila_1
Question sequence:
What are the payments of the customer named LINDA?
What are the dates of these payments?
And when did the first payment happen?
SQL query sequence:
SELECT * FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "LINDA"
SELECT T2.payment_date FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "LINDA"
SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
Final question: When did the first payment happen?
Final SQL: SELECT payment_date FROM payment ORDER BY payment_date ASC LIMIT 1
Database: sakila_1
Question sequence:
How many payments did LINDA make?
Tell me all the information about the largest one.
tell me where she lives, and also her email.
SQL query sequence:
SELECT COUNT(*) FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "LINDA"
SELECT * FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "LINDA" ORDER BY T2.amount DESC LIMIT 1
SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  'LINDA'
Final question: Where does the customer with the first name Linda live? And what is her email?
Final SQL: SELECT T2.address ,  T1.email FROM customer AS T1 JOIN address AS T2 ON T2.address_id  =  T1.address_id WHERE T1.first_name  =  'LINDA'
Database: sakila_1
Question sequence:
Tell me the release year of the film titleed ACE GOLDFINGER.
What is the rating of this film?
tell me all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement.
SQL query sequence:
SELECT release_year FROM film WHERE title = "ACE GOLDFINGER"
SELECT rating FROM film WHERE title = "ACE GOLDFINGER"
SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
Final question: Find all the films longer than 100 minutes, or rated PG, except those who cost more than 200 for replacement. List the titles.
Final SQL: SELECT title FROM film WHERE LENGTH  >  100 OR rating  =  'PG' EXCEPT SELECT title FROM film WHERE replacement_cost  >  200
Database: sakila_1
Question sequence:
Tell me the email of the customer named MARIA.
Tell me all the information about her rentals.
What is the first name and the last name of the customer who made the earliest rental?
SQL query sequence:
SELECT email FROM customer WHERE first_name = "MARIA"
SELECT * FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.first_name = "MARIA"
SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
Final question: What is the first name and the last name of the customer who made the earliest rental?
Final SQL: SELECT T1.first_name ,  T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id ORDER BY T2.rental_date ASC LIMIT 1
Database: sakila_1
Question sequence:
Tell me the customer of rental with id 2.
How about its return date?
What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?
SQL query sequence:
SELECT T1.first_name, T1.last_name FROM customer AS T1 JOIN rental AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.rental_id = 2
SELECT return_date FROM rental WHERE rental_id = 2
SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  'APRIL' AND T3.last_name  =  'BURNS'
Final question: What is the full name of the staff member who has rented a film to a customer with the first name April and the last name Burns?
Final SQL: SELECT DISTINCT T1.first_name ,  T1.last_name FROM staff AS T1 JOIN rental AS T2 ON T1.staff_id  =  T2.staff_id JOIN customer AS T3 ON T2.customer_id  =  T3.customer_id WHERE T3.first_name  =  'APRIL' AND T3.last_name  =  'BURNS'
Database: sakila_1
Question sequence:
Tell me all the information about the stores.
Tell me how many items are in store 3.
Which store has the most customers?
SQL query sequence:
SELECT * FROM store
SELECT COUNT(*) FROM inventory WHERE store_id = 3
SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
Final question: Which store has most the customers?
Final SQL: SELECT store_id FROM customer GROUP BY store_id ORDER BY count(*) DESC LIMIT 1
Database: sakila_1
Question sequence:
Tell me all the information about Lisa's payments.
What's the largest one among those? Give the payment amount.
What's the largest one among all the payments?
SQL query sequence:
SELECT * FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "Lisa"
SELECT T2.amount FROM customer AS T1 JOIN payment AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id WHERE T1.first_name = "Lisa" ORDER BY T2.amount DESC LIMIT 1
SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
Final question: What is the largest payment amount?
Final SQL: SELECT amount FROM payment ORDER BY amount DESC LIMIT 1
Database: sakila_1
Question sequence:
Tell me the store in which the staff member with first name "Elsa" works.
Tell me her email.
Where does she live?
SQL query sequence:
SELECT * FROM staff AS T1 JOIN store AS T2 ON T1.store_id  =  T2.store_id WHERE T1.first_name  =  'Elsa'
SELECT email FROM staff WHERE first_name  =  'Elsa'
SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  'Elsa'
Final question: Where does the staff member with the first name Elsa live?
Final SQL: SELECT T2.address FROM staff AS T1 JOIN address AS T2 ON T1.address_id  =  T2.address_id WHERE T1.first_name  =  'Elsa'
Database: customers_and_invoices
Question sequence:
Show the id for all accounts.
Also show the date the account opened and the account name.
Also show account details.
SQL query sequence:
SELECT account_id  FROM Accounts
SELECT account_id ,  date_account_opened ,  account_name  FROM Accounts
SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts
Final question: Show the id, the date of account opened, the account name, and other account detail for all accounts.
Final SQL: SELECT account_id ,  date_account_opened ,  account_name ,  other_account_details FROM Accounts
Database: customers_and_invoices
Question sequence:
Show the account id for all accounts.
Also show the customer first name for these accounts.
What are the ids for the accounts owned by the customer with first name 'Meaghan'?
Also show the account name, and other account details for these accounts.
SQL query sequence:
SELECT account_id FROM Accounts
SELECT T1.account_id, T2.customer_first_name  FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id
SELECT T1.account_id  FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  'Meaghan'
SELECT T1.account_id ,  T1.date_account_opened ,  T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  'Meaghan'
Final question: Show the id, the account name, and other account details for all accounts by the customer with first name 'Meaghan'.
Final SQL: SELECT T1.account_id ,  T1.date_account_opened ,  T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  'Meaghan'
Database: customers_and_invoices
Question sequence:
Show the account name and other account details for all accounts.
How about those accounts by the customer with first name Meaghan and last name Keeling?
SQL query sequence:
SELECT account_name ,  other_account_details FROM Accounts
SELECT T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Meaghan" AND T2.customer_last_name  =  "Keeling"
Final question: Show the account name and other account detail for all accounts by the customer with first name Meaghan and last name Keeling.
Final SQL: SELECT T1.account_name ,  T1.other_account_details FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T2.customer_first_name  =  "Meaghan" AND T2.customer_last_name  =  "Keeling"
Database: customers_and_invoices
Question sequence:
Show the first name and last name for all customers.
Also show their account names.
Who has the account with name 900?
SQL query sequence:
SELECT customer_first_name ,  customer_last_name FROM Customers
SELECT T2.customer_first_name ,  T2.customer_last_name, T1.account_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id
SELECT T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "900"
Final question: Show the first name and last name for the customer with account name 900.
Final SQL: SELECT T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id WHERE T1.account_name  =  "900"
Database: customers_and_invoices
Question sequence:
Show the first name, last name, and phone number for all customers.
How about those with an account?
Show their distinct information.
SQL query sequence:
SELECT customer_first_name ,  customer_last_name ,  phone_number FROM Customers
SELECT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Final question: Show the unique first names, last names, and phone numbers for all customers with any account.
Final SQL: SELECT DISTINCT T1.customer_first_name ,  T1.customer_last_name ,  T1.phone_number FROM Customers AS T1 JOIN Accounts AS T2 ON T1.customer_id  =  T2.customer_id
Database: customers_and_invoices
Question sequence:
Show customer ids for all customers.
Show ids for those who have an account.
How about those who don't?
SQL query sequence:
SELECT customer_id FROM Customers
SELECT customer_id FROM Accounts
SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts
Final question: Show customer ids who don't have an account.
Final SQL: SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts
Database: customers_and_invoices
Question sequence:
Show the id for all customers with an account.
How many accounts do each of them have?
SQL query sequence:
SELECT customer_id FROM Accounts
SELECT count(*) ,  customer_id FROM Accounts GROUP BY customer_id
Final question: How many accounts does each customer have? List the number and customer id.
Final SQL: SELECT count(*) ,  customer_id FROM Accounts GROUP BY customer_id
Database: customers_and_invoices
Question sequence:
Show the customer id for all customers with an account.
Also show their first and last name.
Order them by the number of accounts in descending order.
Who has the most?
SQL query sequence:
SELECT customer_id FROM Accounts
SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id
SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC
SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Final question: What is the customer id, first and last name with most number of accounts.
Final SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1
Database: customers_and_invoices
Question sequence:
Show the first name and last name for all customers.
Also show the number of accounts owned by each of them.
Also show their customer ids.
SQL query sequence:
SELECT customer_first_name ,  customer_last_name from Customers
SELECT T2.customer_first_name ,  T2.customer_last_name ,  count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name ,  count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
Final question: Show id, first name and last name for all customers and the number of accounts.
Final SQL: SELECT T1.customer_id ,  T2.customer_first_name ,  T2.customer_last_name ,  count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
Database: customers_and_invoices
Question sequence:
Show the first name and id for all customers with an accout.
For each of them, also count the number of accounts.
Show the first name and id for those with at least 2 accounts.
SQL query sequence:
SELECT T2.customer_first_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id
SELECT T2.customer_first_name ,  T1.customer_id , count(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id
SELECT T2.customer_first_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
Final question: Show first name and id for all customers with at least 2 accounts.
Final SQL: SELECT T2.customer_first_name ,  T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id HAVING count(*)  >=  2
Database: customers_and_invoices
Question sequence:
Show the total number of customers.
Break down this number by gender.
SQL query sequence:
SELECT count(*) FROM Customers
SELECT gender ,  count(*) FROM Customers GROUP BY gender
Final question: Show the number of customers for each gender.
Final SQL: SELECT gender ,  count(*) FROM Customers GROUP BY gender
Database: customers_and_invoices
Question sequence:
Show the information for all financial transactions.
How many are there?
SQL query sequence:
SELECT * FROM Financial_transactions
SELECT count(*) FROM Financial_transactions
Final question: How many transactions do we have?
Final SQL: SELECT count(*) FROM Financial_transactions
Database: customers_and_invoices
Question sequence:
Show the id of accounts with a financial transaction.
For each of them, count the number of financial transactions.
SQL query sequence:
SELECT account_id FROM Financial_transactions
SELECT count(*) ,  account_id FROM Financial_transactions GROUP BY account_id
Final question: How many transaction does each account have? Show the number and account id.
Final SQL: SELECT count(*) ,  account_id FROM Financial_transactions
Database: customers_and_invoices
Question sequence:
Show the transaction id for each financial transaction.
Also show the account name for each of them.
Limit the results to transactions from accounts with the account name 337.
How many of those are there?
SQL query sequence:
select transaction_id FROM Financial_transactions
SELECT T1.transaction_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id
SELECT T1.transaction_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
Final question: How many transaction does account with name 337 have?
Final SQL: SELECT count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id WHERE T2.account_name  =  "337"
Database: customers_and_invoices
Question sequence:
Show the transaction amount for each transaction.
What is the average?
Also show the minimum, maximum, and total.
SQL query sequence:
SELECT transaction_amount FROM Financial_transactions
SELECT avg(transaction_amount) FROM Financial_transactions
SELECT avg(transaction_amount) ,  min(transaction_amount) ,  max(transaction_amount) ,   sum(transaction_amount) FROM Financial_transactions
Final question: What is the average, minimum, maximum, and total transaction amount?
Final SQL: SELECT avg(transaction_amount) ,  min(transaction_amount) ,  max(transaction_amount) ,   sum(transaction_amount) FROM Financial_transactions
Database: customers_and_invoices
Question sequence:
Show ids for all transactions.
What is the average transaction amount?
What are the ids of transactions whose amount is greater than it?
SQL query sequence:
SELECT transaction_id FROM Financial_transactions
SELECT avg(transaction_amount) FROM Financial_transactions
SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
Final question: Show ids for all transactions whose amounts are greater than the average.
Final SQL: SELECT transaction_id FROM Financial_transactions WHERE transaction_amount  >  (SELECT avg(transaction_amount) FROM Financial_transactions)
Database: customers_and_invoices
Question sequence:
Show the transaction type for each transaction.
For each type, what is the total amount of transactions?
SQL query sequence:
SELECT transaction_type FROM Financial_transactions
SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
Final question: Show the transaction types and the total amount of transactions.
Final SQL: SELECT transaction_type ,  sum(transaction_amount) FROM Financial_transactions GROUP BY transaction_type
Database: customers_and_invoices
Question sequence:
Show the account id for each transaction.
Also show the account name for each.
For each account, show the number of transactions.
SQL query sequence:
SELECT account_id FROM Financial_transactions
SELECT T2.account_name ,  T1.account_id FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id
SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
Final question: Show the account name, id and the number of transactions for each account.
Final SQL: SELECT T2.account_name ,  T1.account_id ,  count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
Database: customers_and_invoices
Question sequence:
Show the account id for each transaction.
For each of them, show the number of transactions.
Order the ids in descending order of the number of transactions.
Which id has the most?
SQL query sequence:
SELECT account_id FROM Financial_transactions
SELECT account_id, count(*) FROM Financial_transactions GROUP BY account_id
SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC
SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
Final question: Show the account id with most number of transactions.
Final SQL: SELECT account_id FROM Financial_transactions GROUP BY account_id ORDER BY count(*) DESC LIMIT 1
Database: customers_and_invoices
Question sequence:
Show the account id and name for each account with a transaction.
Also count the number of transactions for each of them.
Which of them have at least 4 transactions?
SQL query sequence:
SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id
SELECT T1.account_id ,  T2.account_name , count(*) FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id
SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
Final question: Show the account id and name with at least 4 transactions.
Final SQL: SELECT T1.account_id ,  T2.account_name FROM Financial_transactions AS T1 JOIN Accounts AS T2 ON T1.account_id  =  T2.account_id GROUP BY T1.account_id HAVING count(*)  >=  4
Database: customers_and_invoices
Question sequence:
Show information for all products.
What are their sizes?
Only show distinct sizes.
SQL query sequence:
SELECT * FROM Products
SELECT product_size FROM Products
SELECT DISTINCT product_size FROM Products
Final question: Show all product sizes.
Final SQL: SELECT DISTINCT product_size FROM Products
Database: customers_and_invoices
Question sequence:
Show info for all products.
Show their distinct colors.
SQL query sequence:
SELECT * FROM Products
SELECT DISTINCT product_color FROM Products
Final question: Show all product colors.
Final SQL: SELECT DISTINCT product_color FROM Products
Database: customers_and_invoices
Question sequence:
Show the invoice number for each transaction.
For each of them, show the number of transactions.
SQL query sequence:
SELECT invoice_number FROM Financial_transactions
SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number
Final question: Show the invoice number and the number of transactions for each invoice.
Final SQL: SELECT invoice_number ,  count(*) FROM Financial_transactions GROUP BY invoice_number