id
int64
0
9.43k
db_id
stringclasses
69 values
schema
stringclasses
69 values
question
stringlengths
24
325
output
stringlengths
23
804
evidence
stringlengths
0
673
filtered_schema
listlengths
0
16
6,000
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many orders were returned in the year 2020?
SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Returned' AND STRFTIME('%Y', T2.status_date) = '2020'
returned refers to status_value = 'Returned'; in the year 2020 refers to status_date LIKE '%2020%'
[ "order_history.status_date", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,001
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the second-least common method of shipping?
SELECT T2.method_name FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id GROUP BY T2.method_name ORDER BY COUNT(T2.method_id) ASC LIMIT 1, 1
method of shipping refers to method_name; least method refers to Min(Count(method_id))
[ "cust_order.shipping_method_id", "shipping_method.method_id", "shipping_method.method_name" ]
6,002
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many of the customer addresses are inactive?
SELECT COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T1.status_id = T2.status_id WHERE T2.address_status = 'Inactive'
addresses are inactive refers to address_status = 'Inactive'
[ "address_status.address_status", "address_status.status_id", "customer_address.status_id" ]
6,003
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the book with the most orders?
SELECT T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id GROUP BY T2.title ORDER BY COUNT(T1.book_id) DESC LIMIT 1
books refers to title; the most orders refers to Max(Count(order_id))
[ "book.book_id", "book.title", "order_line.book_id" ]
6,004
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the address that received the most orders?
SELECT T2.street_name, T2.city FROM cust_order AS T1 INNER JOIN address AS T2 ON T1.dest_address_id = T2.address_id GROUP BY T2.street_number, T2.street_name, T2.city ORDER BY COUNT(T1.dest_address_id) DESC LIMIT 1
address refers to street_name, city; received the most orders refers to Max(count(dest_address_id))
[ "address.address_id", "address.city", "address.street_name", "address.street_number", "cust_order.dest_address_id" ]
6,005
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How much time does it take to update the status of order "2398"?
SELECT strftime('%J', T2.status_date) - strftime('%J', T1.order_date) FROM cust_order AS T1 INNER JOIN order_history AS T2 ON T1.order_id = T2.order_id WHERE T1.order_id = 2398
"2398" is the order_id; time =   Subtract(strftime('%Y', status_date), strftime('%Y', order_date)) AS "year" , Subtract(strftime('%m', status_date), strftime('%m', order_date)) AS "month", Subtract (strftime('%d', status_date), strftime('%d', order_date)) AS "day"
[ "cust_order.order_date", "cust_order.order_id", "order_history.order_id", "order_history.status_date" ]
6,006
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which customer has the most addresses?
SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(T2.customer_id) DESC LIMIT 1
customer refers to first_name, last_name; the most address refers to Max(count(address_id))
[ "customer.customer_id", "customer.first_name", "customer.last_name", "customer_address.customer_id" ]
6,007
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What percentage of the total prices of all orders are shipped internationally?
SELECT CAST(SUM(CASE WHEN T3.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cust_order AS T1 INNER JOIN order_line AS T2 ON T1.order_id = T2.order_id INNER JOIN shipping_method AS T3 ON T3.method_id = T1.shipping_method_id
shipped internationally refers to method_name = 'International'; percentage = Divide (Sum(price where method_name = 'International'), Sum(price)) * 100
[ "cust_order.order_id", "cust_order.shipping_method_id", "order_line.order_id", "shipping_method.method_id", "shipping_method.method_name" ]
6,008
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all the authors who wrote fewer pages than the average.
SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.num_pages < ( SELECT AVG(num_pages) FROM book )
author refers to author_name; who wrote fewer pages than the average refers to num_pages < AVG(num_pages)
[ "author.author_id", "author.author_name", "book.book_id", "book.num_pages", "book_author.author_id", "book_author.book_id" ]
6,009
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Other than zero, what is the lowest price paid by a customer for an order?
SELECT MIN(price) FROM order_line WHERE price <> 0
other than 0 refers to price ! = 0; lowest price paid refers to Min(price)
[ "order_line.price" ]
6,010
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many customers have an address that is located in the city of Villeneuve-la-Garenne?
SELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne'
"Villeneuve-la-Garenne" is the city
[ "address.address_id", "address.city" ]
6,011
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many authors are named Adam?
SELECT COUNT(*) FROM author WHERE author_name LIKE 'Adam%'
authors named Adam refers to author_name LIKE 'Adam'
[ "author.author_name" ]
6,012
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many customers use a Yahoo! Mail e-mail address?
SELECT COUNT(*) FROM customer WHERE email LIKE '%@yahoo.com'
Yahoo! Mail e-mail address refers to email LIKE '%@yahoo.com'
[ "customer.email" ]
6,013
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What are the city addresses of the customers located in the United States of America?
SELECT DISTINCT T2.city FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id WHERE T1.country_name = 'United States of America'
"United States of America" is the country_name
[ "address.city", "address.country_id", "country.country_id", "country.country_name" ]
6,014
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many orders did Marcelia Goering place in 2021 that uses the Priority Shipping method?
SELECT COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Marcelia' AND T1.last_name = 'Goering' AND STRFTIME('%Y', T2.order_date) = '2021' AND T3.method_name = 'Priority'
in 2021 refers to substr(order_date, 1, 4) = '2021'; priority shipping method refers to method_name = 'Priority'
[ "cust_order.customer_id", "cust_order.order_date", "cust_order.shipping_method_id", "customer.customer_id", "customer.first_name", "customer.last_name", "shipping_method.method_id", "shipping_method.method_name" ]
6,015
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which books have the most expensive price?
SELECT T2.title FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id ORDER BY T1.price DESC LIMIT 1
most expensive book refers to Max(price)
[ "book.book_id", "book.title", "order_line.book_id", "order_line.price" ]
6,016
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many customers ordered the book titled "Anleitung zum Zickigsein"
SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Anleitung zum Zickigsein'
"Anleitung zum Zickigsein" is the title of the book
[ "book.book_id", "book.title", "order_line.book_id" ]
6,017
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the most expensive price paid by a customer for the book "Bite Me If You Can (Argeneau #6)"?
SELECT MAX(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'Bite Me If You Can (Argeneau #6)'
"Bite Me If You Can (Argeneau #6)" is the title of the book; most expensive price refers to Max(price)
[ "book.book_id", "book.title", "order_line.book_id", "order_line.price" ]
6,018
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many customers ordered the oldest book?
SELECT COUNT(*) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id GROUP BY T1.publication_date ORDER BY T1.publication_date ASC LIMIT 1
oldest book refers to Min(publiation_date)
[ "book.book_id", "book.publication_date", "order_line.book_id" ]
6,019
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all the titles of the Spanish books published by Alfaguara.
SELECT T2.title FROM book_language AS T1 INNER JOIN book AS T2 ON T2.language_id = T1.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T1.language_name = 'Spanish' AND T3.publisher_name = 'Alfaguara' GROUP BY T2.title
"Spanish" is the language_name; 'Alfaguara' is the publisher_name
[ "book.language_id", "book.publisher_id", "book.title", "book_language.language_id", "book_language.language_name", "publisher.publisher_id", "publisher.publisher_name" ]
6,020
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many customers ordered Stephen King's first book?
SELECT COUNT(T1.publication_date) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN order_line AS T4 ON T4.book_id = T1.book_id WHERE T3.author_name = 'Stephen King' ORDER BY T1.publication_date ASC LIMIT 1
"Stephen King" is the author_name; first book refers to Min(publication_date)
[ "author.author_id", "author.author_name", "book.book_id", "book.publication_date", "book_author.author_id", "book_author.book_id", "order_line.book_id" ]
6,021
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What are the languages of the first two published books?
SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id ORDER BY T1.publication_date ASC LIMIT 2
first two published book refers to Min(publication_date); language refers to language_name
[ "book.language_id", "book.publication_date", "book_language.language_id", "book_language.language_name" ]
6,022
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who published the book "The Secret Garden"?
SELECT DISTINCT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Secret Garden'
"The Secret Garden" is the title of the book; who published the book refers to publisher_name
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,023
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Among the books that were published by Scholastic, how many were written by J.K Rowling?
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id INNER JOIN book_author AS T3 ON T3.book_id = T1.book_id INNER JOIN author AS T4 ON T4.author_id = T3.author_id WHERE T2.publisher_name = 'Scholastic' AND T4.author_name = 'J.K. Rowling'
"J.K Rowling" is the author_name; 'Scholastic' is the publisher_name
[ "author.author_id", "author.author_name", "book.book_id", "book.publisher_id", "book_author.author_id", "book_author.book_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,024
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What are the names of all the publishers who have published at least 30 books?
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name HAVING COUNT(T2.publisher_name) >= 30
published at least 30 books refers to Count(book_id) > = 30
[ "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,025
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Indicate the last number of each street.
SELECT street_number FROM address
street refers to street_name; last number of each street refers to Substr (street_number, -1)
[ "address.street_number" ]
6,026
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Indicate the complete address of customers located in Lazaro Cardenas.
SELECT street_number, street_name, city, country_id FROM address WHERE city = 'Lazaro Cardenas'
complete address refers to street_number, street_name, city, country; "Lazaro Cardenas" is the city
[ "address.city", "address.country_id", "address.street_name", "address.street_number" ]
6,027
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Indicate the ISBN13 of all the books that have less than 140 pages and more than 135.
SELECT isbn13 FROM book WHERE num_pages < 140 AND num_pages > 135
ISBN13 refers to isbn13; less than 140 pages and more than 135 refers to num_pages > 135 AND num_pages < 140;
[ "book.isbn13", "book.num_pages" ]
6,028
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Indicate the title of the six books with the greatest potential value as collectibles.
SELECT title FROM book ORDER BY publication_date ASC LIMIT 6
greatest potential value refers to Min(publication_date)
[ "book.publication_date", "book.title" ]
6,029
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books were ordered in the last month of the year 2020?
SELECT COUNT(*) FROM cust_order WHERE order_date LIKE '2020-12%'
ordered in last month of the year 2020 refers to Substr(order_date, 1, 7) = '2020-12'
[ "cust_order.order_date" ]
6,030
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Indicate the full name of all customers whose last name begins with the letter K.
SELECT first_name, last_name FROM customer WHERE last_name LIKE 'K%'
full name refers to first_name, last_name; last name begin with the letter 'K' refers to last_name LIKE 'K%'
[ "customer.first_name", "customer.last_name" ]
6,031
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
In which cities are the customers of Costa Rica located?
SELECT T1.city FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Costa Rica'
"Costa Rica" is the country_name
[ "address.city", "address.country_id", "country.country_id", "country.country_name" ]
6,032
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which customer addresses are no longer active?
SELECT DISTINCT T1.street_name FROM address AS T1 INNER JOIN customer_address AS T2 ON T1.address_id = T2.address_id INNER JOIN address_status AS T3 ON T3.status_id = T2.status_id WHERE T3.address_status = 'Inactive'
no longer active refers to address_status = 'Inactive'; customer address refers to street_number, street_name, city
[ "address.address_id", "address.street_name", "address_status.address_status", "address_status.status_id", "customer_address.address_id", "customer_address.status_id" ]
6,033
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the full name of the customers who live in Baiyin city?
SELECT T3.first_name, T3.last_name FROM address AS T1 INNER JOIN customer_address AS T2 ON T1.address_id = T2.address_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T1.city = 'Baiyin'
full name refers to first_name, last_name; 'Baiyin' is the city
[ "address.address_id", "address.city", "customer.customer_id", "customer.first_name", "customer.last_name", "customer_address.address_id", "customer_address.customer_id" ]
6,034
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the email of the customers who place their orders with priority method?
SELECT T1.email FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T3.method_name = 'Priority'
priority method refers to method_name = 'Priority'
[ "cust_order.customer_id", "cust_order.shipping_method_id", "customer.customer_id", "customer.email", "shipping_method.method_id", "shipping_method.method_name" ]
6,035
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
On what date did the customers who live at number 460 of their respective streets place their orders?
SELECT T1.order_date FROM cust_order AS T1 INNER JOIN address AS T2 ON T1.dest_address_id = T2.address_id WHERE T2.street_number = 460
live at number 460 refers to street_number = '460'; date the customers placed their orders refers to order_date
[ "address.address_id", "address.street_number", "cust_order.dest_address_id", "cust_order.order_date" ]
6,036
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Identify by their id all the orders that have been cancelled.
SELECT T2.order_id FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled'
have been cancelled refers to status_value = 'cancelled'; id refers to order_id
[ "order_history.order_id", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,037
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the status of the orders placed on 04/10/2022?
SELECT DISTINCT T1.status_value FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id WHERE T3.order_date LIKE '2022-04-10%'
placed on 04/10/2022 refers to SUBSTR(order_date, 1, 10) = '2022-04-10'; status of order refers to status_value
[ "cust_order.order_date", "cust_order.order_id", "order_history.order_id", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,038
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the highest price at which a customer bought the book 'The Prophet'?
SELECT MAX(T2.price) FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Prophet'
"The Prophet" is the title of the book; highest price refers to Max(price)
[ "book.book_id", "book.title", "order_line.book_id", "order_line.price" ]
6,039
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
On what dates were books ordered at a price of 16.54?
SELECT T1.order_date FROM cust_order AS T1 INNER JOIN order_line AS T2 ON T1.order_id = T2.order_id WHERE T2.price = 16.54
price of 16.54 refers to price = 16.54; dates the book ordered refers to order_date
[ "cust_order.order_date", "cust_order.order_id", "order_line.order_id", "order_line.price" ]
6,040
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List the titles of all the books that Peter H. Smith wrote.
SELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Peter H. Smith'
"Peter H.Smit" is the author_name
[ "author.author_id", "author.author_name", "book.book_id", "book.title", "book_author.author_id", "book_author.book_id" ]
6,041
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books under 300 pages has HarperCollins Publishers published?
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'HarperCollins Publishers' AND T1.num_pages < 300
under 300 pages refers to num_pages < 300; 'HarperCollins Publishers" is the publisher_name
[ "book.num_pages", "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,042
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books have been published in Japanese?
SELECT COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'
in Japanese refers to language_name = 'Japanese
[ "book.language_id", "book_language.language_id", "book_language.language_name" ]
6,043
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the average number of pages in the books written by Jennifer Crusie?
SELECT AVG(T1.num_pages) FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Jennifer Crusie'
"Jennifer Crusie" is the author_name; average number of pages refers to AVG(num_pages)
[ "author.author_id", "author.author_name", "book.book_id", "book.num_pages", "book_author.author_id", "book_author.book_id" ]
6,044
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What percentage of the orders placed by Kaleena were shipped by the international method?
SELECT CAST(SUM(CASE WHEN T3.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T2.shipping_method_id WHERE T1.first_name = 'Kaleena'
shipped by international method refers to method_name = 'International'; percentage = Divide (Sum(method_name = 'International'), Count(method_name)) * 100
[ "cust_order.customer_id", "cust_order.shipping_method_id", "customer.customer_id", "customer.first_name", "shipping_method.method_id", "shipping_method.method_name" ]
6,045
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the full name of the customers who have ordered the book The Sorrows of Young Werther.
SELECT T4.first_name, T4.last_name FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.title = 'The Sorrows of Young Werther'
full name refers to first_name, last_name; 'The Sorrows of Young Werther' is the title of the book
[ "book.book_id", "book.title", "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.book_id", "order_line.order_id" ]
6,046
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List every book that Ursola Purdy has ordered.
SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.first_name = 'Ursola' AND T4.last_name = 'Purdy'
book refers to title
[ "book.book_id", "book.title", "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.book_id", "order_line.order_id" ]
6,047
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who is the author of the book with the biggest page count?
SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id ORDER BY T1.num_pages DESC LIMIT 1
author refers to author_name, biggest page count refers to Max(num_pages)
[ "author.author_id", "author.author_name", "book.book_id", "book.num_pages", "book_author.author_id", "book_author.book_id" ]
6,048
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books written by Akira Watanabe are available on Gravity?
SELECT COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id WHERE T1.author_name = 'Akira Watanabe'
"Akira Watanabe" is the author_name
[ "author.author_id", "author.author_name", "book_author.author_id" ]
6,049
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the full address of Ursola Purdy.
SELECT T3.street_number, T3.street_name, T3.city FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN country AS T4 ON T4.country_id = T3.country_id WHERE T1.first_name = 'Ursola' AND T1.last_name = 'Purdy'
full address refers to street_number, street_name, city, country_name
[ "address.address_id", "address.city", "address.country_id", "address.street_name", "address.street_number", "country.country_id", "customer.customer_id", "customer.first_name", "customer.last_name", "customer_address.address_id", "customer_address.customer_id" ]
6,050
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who is the author of the book The Mystery in the Rocky Mountains?
SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'The Mystery in the Rocky Mountains'
author refers to author_name; 'The Mystery in the Rocky Mountains' is the title of the book
[ "author.author_id", "author.author_name", "book.book_id", "book.title", "book_author.author_id", "book_author.book_id" ]
6,051
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Identify the publisher of the book Girls' Night In.
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'Girls'' Night In'
"Girls' Night In" is the title of the book; publisher is the publisher_name
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,052
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Name the publisher of the oldest book.
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id ORDER BY T1.publication_date ASC LIMIT 1
publisher refers to publisher_name;  oldest book refers to Min(publication_date)
[ "book.publication_date", "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,053
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Identify the cost difference between Priority and Express shipping methods.
SELECT SUM(CASE WHEN method_name = 'Priority' THEN cost ELSE 0 END) - SUM(CASE WHEN method_name = 'Express' THEN cost ELSE 0 END) FROM shipping_method
"Priority" and "Express" are both method_name; cost difference = Subtract (Sum(cost where method_name = 'Express'), Sum(cost where method_name 'Priority'))
[ "shipping_method.cost", "shipping_method.method_name" ]
6,054
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many orders have been cancelled in 2022?
SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Cancelled' AND STRFTIME('%Y', T2.status_date) = '2022'
cancelled refers to status_value = 'Cancelled'; in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'
[ "order_history.status_date", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,055
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all the books published by BBC Audiobooks.
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'BBC Audiobooks'
"BBC Audiobooks" refers to publisher_name; books refers to title
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,056
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books were published in 2017?
SELECT COUNT(*) FROM book WHERE STRFTIME('%Y', publication_date) = '2017'
published in 2017 refers to Substr(publication_date,1, 4) = '2017'
[ "book.publication_date" ]
6,057
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the International Standard Book Number of the book The Mystery in the Rocky Mountains.
SELECT isbn13 FROM book WHERE title = 'The Mystery in the Rocky Mountains'
International Standard Book Number refers to isbn13; 'The Mystery in the Rocky Mountains' is the title of the book
[ "book.isbn13", "book.title" ]
6,058
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Among all orders updated in 2022, identify the percentage that has been returned.
SELECT CAST(SUM(CASE WHEN T1.status_value = 'Returned' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE STRFTIME('%Y', T2.status_date) = '2022'
order updated in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'; has been returned refers to status_value = 'Returned'; percentage = Divide (Count(status_value = 'Returned'), Count(status_value)) * 100
[ "order_history.status_date", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,059
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Among all addresses provided by customers, identify the percentage that are not in use anymore.
SELECT CAST(SUM(CASE WHEN T2.address_status = 'Inactive' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T2.status_id = T1.status_id
address not in use refers to address_status = 'Inactive'; percentage = Divide (Count(address_status = 'Inactive'), Count(address_status)) * 100
[ "address_status.address_status", "address_status.status_id", "customer_address.status_id" ]
6,060
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many pages does 'Seaward' have?
SELECT num_pages FROM book WHERE title = 'Seaward'
"Seaward" is the title of the book; pages refers to num_pages
[ "book.num_pages", "book.title" ]
6,061
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who is the author of First Things First?
SELECT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T1.title = 'First Things First'
"First Things First" is the title of the book; author refers to author_name
[ "author.author_id", "author.author_name", "book.book_id", "book.title", "book_author.author_id", "book_author.book_id" ]
6,062
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all books authored by Tom Clancy.
SELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Tom Clancy'
"Tom Clancy" is the author_name; books refers title
[ "author.author_id", "author.author_name", "book.book_id", "book.title", "book_author.author_id", "book_author.book_id" ]
6,063
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which book by Hirohiko Araki was published on 6/6/2006?
SELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'Hirohiko Araki' AND T1.publication_date = '2006-06-06'
"Hirohiko Araki" is the author_name; on 6/6/2006 refers to publication_date = '2006-06-06'; which book refers to title
[ "author.author_id", "author.author_name", "book.book_id", "book.publication_date", "book.title", "book_author.author_id", "book_author.book_id" ]
6,064
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who is the publisher of Hitchhiker's Guide To The Galaxy: The Filming of the Douglas Adams classic?
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'Hitchhiker''s Guide To The Galaxy: The Filming of the Douglas Adams classic'
"Hitchhiker's Guide To The Galaxy: The Filming of the Douglas Adams classic" is the title of the book; publisher refers to publisher_name
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,065
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all books published by ADV Manga.
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'ADV Manga'
"ADV Manga" is the publisher_name; books refers to title
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,066
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Write the full name of the customers whose address is at 55 Dorton Pass, Huangqiao.
SELECT DISTINCT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id WHERE T3.street_number = 55 AND T3.street_name = 'Dorton Pass' AND T3.city = 'Huangqiao'
full name refers to first_name, last_name; '55' is the street_number, 'Dorton Pass' is the street_name; 'Huangqiao' is the city
[ "address.address_id", "address.city", "address.street_name", "address.street_number", "customer.customer_id", "customer.first_name", "customer.last_name", "customer_address.address_id", "customer_address.customer_id" ]
6,067
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which country is 9 Green Ridge Point, Arendal located at?
SELECT T2.country_name FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T1.street_number = 9 AND T1.street_name = 'Green Ridge Point' AND T1.city = 'Arendal'
"9" is the street_number; 'Green Reidge Point' is the street_name; 'Arendal' is the city
[ "address.city", "address.country_id", "address.street_name", "address.street_number", "country.country_id", "country.country_name" ]
6,068
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List 10 addresses located in Poland.
SELECT T1.street_number, T1.street_name, T1.city FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Poland' LIMIT 10
"Polan" is the country_name; address refers to street_number, street_name, city
[ "address.city", "address.country_id", "address.street_name", "address.street_number", "country.country_id", "country.country_name" ]
6,069
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the shipping method ordered by Nicolette Sadler at 6/29/2020 7:40:07 PM?
SELECT T3.method_name FROM cust_order AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id INNER JOIN shipping_method AS T3 ON T3.method_id = T1.shipping_method_id WHERE T2.first_name = 'Nicolette' AND T2.last_name = 'Sadler' AND T1.order_date = '2020-06-29 19:40:07'
ordered at 6/29/2020 7:40:07 PM refers to order_date = '2020-06-29 19:40:07'; shipping method refers to method_name
[ "cust_order.customer_id", "cust_order.order_date", "cust_order.shipping_method_id", "customer.customer_id", "customer.first_name", "customer.last_name", "shipping_method.method_id", "shipping_method.method_name" ]
6,070
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List all books written in Arabic.
SELECT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Arabic'
"Arabic" is the language_name; book refers to title
[ "book.language_id", "book.title", "book_language.language_id", "book_language.language_name" ]
6,071
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which language is 'El plan infinito' written in?
SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.title = 'El plan infinito'
"El plan infinito" is the title of the book; language refers to language_name
[ "book.language_id", "book.title", "book_language.language_id", "book_language.language_name" ]
6,072
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What percentage of books written by Hirohiko make up the number of books published by Viz Media?
SELECT CAST(SUM(CASE WHEN T1.author_name = 'Hirohiko Araki' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T2.author_id = T1.author_id INNER JOIN book AS T3 ON T3.book_id = T2.book_id INNER JOIN publisher AS T4 ON T4.publisher_id = T3.publisher_id WHERE T4.publisher_name ...
"Hirohiko Araki" is the author_name; 'Viz Media' is the publisher_name; percentage = Divide (Count(author_name = 'Hirohiko Araki'), Count(book_id)) * 100
[ "author.author_id", "author.author_name", "book.book_id", "book.publisher_id", "book_author.author_id", "book_author.book_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,073
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the average number of book pages written by Zilpha Keatley Snyder?
SELECT AVG(T3.num_pages) FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id INNER JOIN book AS T3 ON T3.book_id = T1.book_id WHERE T2.author_name = 'Zilpha Keatley Snyder'
"Zilpha Keatley Snyder" is the author_name; average number of book pages refers to AVG(num_pages)
[ "author.author_id", "author.author_name", "book.book_id", "book.num_pages", "book_author.author_id", "book_author.book_id" ]
6,074
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the full name of customer with email ckupis4@tamu.edu?
SELECT first_name, last_name FROM customer WHERE email = 'ckupis4@tamu.edu'
"ckupis4@tamu.edu" is the email of customer; full name refers to first_name, last_name
[ "customer.email", "customer.first_name", "customer.last_name" ]
6,075
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which book has the most number of pages?
SELECT title FROM book ORDER BY num_pages DESC LIMIT 1
books with the most number of pages refers to Max(num_pages)
[ "book.num_pages", "book.title" ]
6,076
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books were written by author A.J. Ayer?
SELECT COUNT(*) FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id WHERE T2.author_name = 'A.J. Ayer'
"A.J. Ayer" is the author_name;
[ "author.author_id", "author.author_name", "book_author.author_id" ]
6,077
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Name the title of books written by author A.J.Ayer.
SELECT T3.title FROM book_author AS T1 INNER JOIN author AS T2 ON T1.author_id = T2.author_id INNER JOIN book AS T3 ON T3.book_id = T1.book_id WHERE T2.author_name = 'A.J. Ayer'
"A.J. Ayer" is the author_name;
[ "author.author_id", "author.author_name", "book.book_id", "book.title", "book_author.author_id", "book_author.book_id" ]
6,078
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
The book name "The Season: A Candid Look at Broadway" was published by which publisher?
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Season: A Candid Look at Broadway'
"The Season: A Candid Look at Broadway" is the  title of the book; publisher refers to publisher_name
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,079
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the average of English books among all books published by Carole Marsh Mysteries?
SELECT CAST(SUM(CASE WHEN T1.language_name = 'English' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id INNER JOIN publisher AS T3 ON T3.publisher_id = T2.publisher_id WHERE T3.publisher_name = 'Carole Marsh Mysteries'
English book refers to language_name = 'English'; 'Carole Marsh Mysteries' is the publisher_name; average = Divide (Count(language_name = 'English'), Count(book_id))
[ "book.language_id", "book.publisher_id", "book_language.language_id", "book_language.language_name", "publisher.publisher_id", "publisher.publisher_name" ]
6,080
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher Free Press.
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Free Press' AND STRFTIME('%Y', T1.publication_date) BETWEEN '1990' AND '2000' ORDER BY T1.num_pages DESC LIMIT 1
books with the most number of pages refers to Max(num_pages); published from 1990 to 2000 refers to SUBSTR(publication_date, 1, 4) BETWEEN '1990' AND '2000'; 'Free Press' is the publisher_name
[ "book.num_pages", "book.publication_date", "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,081
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the order price of the book "The Servant Leader" in 2003?
SELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.title = 'The Servant Leader' AND STRFTIME('%Y', T1.publication_date) = '2003'
"The Servant Leader" is the title of the book; book in 2003 refers to SUBSTR(publication_date, 1, 4) = '2003'
[ "book.book_id", "book.publication_date", "book.title", "order_line.book_id", "order_line.price" ]
6,082
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the current address of customer Kandy?
SELECT T3.street_number, T3.street_name, T3.city FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN address_status AS T4 ON T4.status_id = T2.status_id WHERE T1.first_name = 'Kandy'
current address refers to address_status = 1; address refers to street_number, street_name, city
[ "address.address_id", "address.city", "address.street_name", "address.street_number", "address_status.status_id", "customer.customer_id", "customer.first_name", "customer_address.address_id", "customer_address.customer_id", "customer_address.status_id" ]
6,083
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books were ordered by customer Kandy Adamec?
SELECT COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Kandy' AND T3.last_name = 'Adamec'
[ "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.order_id" ]
6,084
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many orders got returned in 2022?
SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Returned' AND STRFTIME('%Y', T2.status_date) = '2022'
orders got returned refers to status_value = 'Returned'; in 2022 refers to SUBSTR(status_date, 1, 4) = '2022'
[ "order_history.status_date", "order_history.status_id", "order_status.status_id", "order_status.status_value" ]
6,085
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Which country does the customer with the email "rturbitt2@geocities.jp" from?
SELECT T4.country_name FROM customer AS T1 INNER JOIN customer_address AS T2 ON T1.customer_id = T2.customer_id INNER JOIN address AS T3 ON T3.address_id = T2.address_id INNER JOIN country AS T4 ON T4.country_id = T3.country_id WHERE T1.email = 'rturbitT2@geocities.jp'
"rturbitt2@geocities.jp" is the email of customer; country refers to country_name
[ "address.address_id", "address.country_id", "country.country_id", "country.country_name", "customer.customer_id", "customer.email", "customer_address.address_id", "customer_address.customer_id" ]
6,086
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Name the publisher who published the most books.
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id GROUP BY T2.publisher_name ORDER BY COUNT(T2.publisher_id) DESC LIMIT 1
published the most books refers to Max(Count(book_id)); publisher refers to publisher_name
[ "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,087
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the title of the first book that was written by A.J. Ayer?
SELECT T1.title FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id WHERE T3.author_name = 'A.J. Ayer' ORDER BY T1.publication_date ASC LIMIT 1
"A.J. Ayer" is the author_name; first book refers to Min(publication_date)
[ "author.author_id", "author.author_name", "book.book_id", "book.publication_date", "book.title", "book_author.author_id", "book_author.book_id" ]
6,088
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the percentage of books that cost greater than $10 and were ordered by customer Ruthanne Vatini?
SELECT CAST(SUM(CASE WHEN T1.price > 10 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id WHERE T3.first_name = 'Ruthanne' AND T3.last_name = 'Vatini'
cost greater than $10 refers to price > 10; percentage = Divide (Count(book_id where price >10), Count(book_id)) * 100; full name refers to the composition of first name, lastname
[ "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.order_id", "order_line.price" ]
6,089
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List the title of books published by AK Press.
SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'AK Press'
"AK Press" is the publisher_name
[ "book.publisher_id", "book.title", "publisher.publisher_id", "publisher.publisher_name" ]
6,090
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Who ordered the book with the cheapest price?
SELECT T3.first_name, T3.last_name FROM order_line AS T1 INNER JOIN cust_order AS T2 ON T2.order_id = T1.order_id INNER JOIN customer AS T3 ON T3.customer_id = T2.customer_id ORDER BY T1.price ASC LIMIT 1
book with cheapest price refers to Min(price); who order means name of customer which refers to first_name, last_name
[ "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.first_name", "customer.last_name", "order_line.order_id", "order_line.price" ]
6,091
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
List down the ISBN of the books purchased by the customer with an email of fsier3e@ihg.com.
SELECT T1.isbn13 FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id INNER JOIN cust_order AS T3 ON T3.order_id = T2.order_id INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T4.email = 'fsier3e@ihg.com'
"fsier3e@ihg.com" is the email of customer; ISBN refers to isbn13
[ "book.book_id", "book.isbn13", "cust_order.customer_id", "cust_order.order_id", "customer.customer_id", "customer.email", "order_line.book_id", "order_line.order_id" ]
6,092
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Give the author's name of the books that cost 19 dollars and above.
SELECT DISTINCT T3.author_name FROM book AS T1 INNER JOIN book_author AS T2 ON T1.book_id = T2.book_id INNER JOIN author AS T3 ON T3.author_id = T2.author_id INNER JOIN order_line AS T4 ON T4.book_id = T1.book_id WHERE T4.price > 19
books cost 19 dollars and above refers to price > = 19
[ "author.author_id", "author.author_name", "book.book_id", "book_author.author_id", "book_author.book_id", "order_line.book_id", "order_line.price" ]
6,093
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the publisher name of the book with ISBN 76092025986.
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.isbn13 = 76092025986
"76092025986" is the isbn13
[ "book.isbn13", "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,094
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Among the books published by Birlinn in 2008, how many books have pages around 600 to 700?
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Birlinn' AND STRFTIME('%Y', T1.publication_date) = '2008' AND T1.num_pages BETWEEN 600 AND 700
"Birlinn" is the publisher_name; books have pages around 600 to 700 refers to num_pages BETWEEN 600 AND 700; in 2008 refers to SUBSTR(publication_date, 1, 4) = '2008'
[ "book.num_pages", "book.publication_date", "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,095
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the price of the book with ISBN 9780763628321?
SELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.isbn13 = 9780763628321
"9780763628321" is the isbn13
[ "book.book_id", "book.isbn13", "order_line.book_id", "order_line.price" ]
6,096
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
What is the number of pages of the book in the order ID 1167?
SELECT T1.num_pages FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.order_id = 1167
number of pages refers to num_pages
[ "book.book_id", "book.num_pages", "order_line.book_id", "order_line.order_id" ]
6,097
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the title of the books published in British-English.
SELECT DISTINCT T1.title FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'British English'
"British English" is the language_name of the book
[ "book.language_id", "book.title", "book_language.language_id", "book_language.language_name" ]
6,098
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
How many books were published by Brava in 2006?
SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Brava' AND STRFTIME('%Y', T1.publication_date) = '2006'
"Brava" is the publisher_name; in 2006 refers to SUBSTR(publication_date, 1, 4) = '2006'
[ "book.publication_date", "book.publisher_id", "publisher.publisher_id", "publisher.publisher_name" ]
6,099
books
CREATE TABLE address_status ( status_id INTEGER primary key, address_status TEXT ); CREATE TABLE author ( author_id INTEGER primary key, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER primary key, language_code TEXT, langua...
Provide the ISBN and price of the book with book ID 7160.
SELECT T1.isbn13, T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T2.book_id = 6503
ISBN refers to isbn13;
[ "book.book_id", "book.isbn13", "order_line.book_id", "order_line.price" ]