Chinastark/bird_dataset huggingface dataset:
Database: books
Question: Calculate the percentage of the International shipping orders on 2022/11/10.
Evidence: International shipping order refers to method_name = 'International'; orders on 2022/11/10 refers to order_date LIKE '2022-11-10%'; percentage = Divide (Sum(order_id  where method_name = 'International'), Count(order_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T1.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipping_method AS T1 INNER JOIN cust_order AS T2 ON T1.method_id = T2.shipping_method_id WHERE T2.order_date LIKE '2022-11-10%'
Database: books
Question: What is the average number of pages of David Coward's books?
Evidence: number of pages refers to num_pages; average = Divide (Sum(num_pages), Count(book_id))
SQL: 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 = 'David Coward'
Database: books
Question: What is the cost of the slowest and least expensive shipping method?
Evidence: slowest and least expesive method refers to shipping_method = 'Standard'
SQL: SELECT method_name FROM shipping_method ORDER BY cost ASC LIMIT 1
Database: books
Question: What is the title of the first book that was published in 1900?
Evidence: published in 1900 refers to publication_date LIKE '1900%'; first book refers to Min(publication_date)
SQL: SELECT title FROM book WHERE STRFTIME('%Y', publication_date) = '1900' ORDER BY publication_date LIMIT 1
Database: books
Question: What is the full name of the customer who owns the "aalleburtonkc@yellowbook.com" e-mail address?
Evidence: "aalleburtonkc@yellowbook.com" is the email of customer; full name refers to first_name, last_name
SQL: SELECT first_name, last_name FROM customer WHERE email = 'aalleburtonkc@yellowbook.com'
Database: books
Question: How many orders in 2022 have Iran as their destinations?
Evidence: Iran as their destination refers to country_name = 'Iran'; orders in 2022 refers to order_date LIKE '2022%'
SQL: SELECT COUNT(*) FROM country AS T1 INNER JOIN address AS T2 ON T1.country_id = T2.country_id INNER JOIN cust_order AS T3 ON T3.dest_address_id = T2.address_id WHERE T1.country_name = 'Iran' AND STRFTIME('%Y', T3.order_date) = '2022'
Database: books
Question: Among Daisey Lamball's orders, how many were shipped via International shipping?
Evidence: via international shipping refers to method_name = 'International'
SQL: 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 = 'Daisey' AND T1.last_name = 'Lamball' AND T3.method_name = 'International'
Database: books
Question: What is the full name of the customer who ordered the most books of all time?
Evidence: customer who ordered the most book refers to customer_id where Max(count(order_id)); full name refers to first_name, last_name
SQL: SELECT T1.first_name, T1.last_name FROM customer AS T1 INNER JOIN cust_order AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.first_name, T1.last_name ORDER BY COUNT(*) DESC LIMIT 1
Database: books
Question: How many orders did Antonia Poltun return?
Evidence: order returned refers to status_value = 'Returned'
SQL: SELECT COUNT(*) 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 INNER JOIN customer AS T4 ON T4.customer_id = T3.customer_id WHERE T1.status_value = 'Returned' AND T4.first_name = 'Antonia' AND T4.last_name = 'Poltun'
Database: books
Question: Which shipping method is preferred by customers the most?
Evidence: shipping method preferred the most by customers refers to method_id where Max(Count(method_id)); which shipping method refers to method_name
SQL: 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) DESC LIMIT 1
Database: books
Question: How many orders were delivered in 2021?
Evidence: delivered refers to status_value = 'Delivered'; in 2021 refers to status_date LIKE '2021%'
SQL: SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Delivered' AND STRFTIME('%Y', T2.status_date) = '2021'
Database: books
Question: What is the name of the first book written by J.K Rowling?
Evidence: "J.K Rowling" is the author_name; first published book refers to book_id where Min(publication_date); name of the book refers to title
SQL: 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 = 'J.K. Rowling' ORDER BY T1.publication_date ASC LIMIT 1
Database: books
Question: How many books did A.R. Braunmuller write?
Evidence: "A.R. Braunmuller" is the author_name
SQL: SELECT COUNT(*) FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id WHERE T1.author_name = 'A.R. Braunmuller'
Database: books
Question: What is the name of the publisher who published Agatha Christie's first book?
Evidence: "Agatha Christie" is the author_name; name of publisher refers to publisher_name; first book refers to Min(publication_date)
SQL: SELECT T4.publisher_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 publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Agatha Christie' ORDER BY T1.publication_date ASC LIMIT 1
Database: books
Question: List all the names of the books written by Danielle Steel.
Evidence: "Danielle Steel" is the author_name; name of books refers to title
SQL: 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 = 'Danielle Steel'
Database: books
Question: How many books by William Shakespeare were published by Penguin Classics?
Evidence: "William Shakespeare" is the author_name; "Penguin Classics" is the publisher_name
SQL: SELECT COUNT(*) 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 publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'William Shakespeare' AND T4.publisher_name = 'Penguin Classics'
Database: books
Question: What is the name of the publisher that published the most books?
Evidence: name of publisher refers to publisher_name; publisher published the most number of books refers to Max(Count(book_id))
SQL: 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
Database: books
Question: What is the total shipping cost of all the orders made by Page Holsey? Indicate how many of the said orders were ordered in 2022.
Evidence: shipping cost refers to cost; ordered in 2022 refers to order_date LIKE '2022%'
SQL: SELECT SUM(T3.cost) 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 = 'Page' AND T1.last_name = 'Holsey' AND STRFTIME('%Y', T2.order_date) = '2022'
Database: books
Question: What is the name of the publisher with publisher ID 22?
Evidence: name of publisher refers to publisher_name
SQL: SELECT publisher_name FROM publisher WHERE publisher_id = 22
Database: books
Question: How many of the books authored by Al Gore have less than 400 pages?
Evidence: "AI Gore" is the author_name; have less than 400 pages refers to num_pages < 400
SQL: SELECT COUNT(*) 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 = 'Al Gore' AND T1.num_pages < 400
Database: books
Question: List the author's and publisher's name of the book published on July 10, 1997.
Evidence: author's name refers to author_name; publisher's name refers to publisher_name; book published on July 10, 1997 refers to publication_date LIKE '1997-07-10'
SQL: SELECT T3.author_name, T4.publisher_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 publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T1.publication_date = '1997-07-10'
Database: books
Question: What is the language of the book with ISBN 23755004321?
Evidence: "23755004321" is the isbn13; language refers to language_name
SQL: SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T1.isbn13 = 23755004321
Database: books
Question: What is the title of the most expensive book?
Evidence: most expensive book refers to Max(price)
SQL: SELECT T1.title FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id ORDER BY T2.price DESC LIMIT 1
Database: books
Question: Calculate the total price of books ordered by customer named Lucas Wyldbore.
Evidence: total price refers to Sum(price); full name is composed of first name, last name
SQL: SELECT SUM(T1.price) 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 = 'Lucas' AND T3.last_name = 'Wyldbore'
Database: books
Question: List the ISBN of the book published in Spanish.
Evidence: "Spanish" is the language_name; ISBN refers to isbn13
SQL: SELECT T1.isbn13 FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id WHERE T2.language_name = 'Spanish'
Database: books
Question: Among the books that cost less than 1 dollar, how many were published by Berkley Trade?
Evidence: book cost less than 1 dollar refers to price < 1; 'Berkley Trade' is the publisher_name;
SQL: SELECT COUNT(*) FROM publisher AS T1 INNER JOIN book AS T2 ON T1.publisher_id = T2.publisher_id INNER JOIN order_line AS T3 ON T3.book_id = T2.book_id WHERE T1.publisher_name = 'Berkley' AND T3.price < 1
Database: books
Question: List the title of the books purchased by the customer named Zia Roizin.
SQL: 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 = 'Zia' AND T4.last_name = 'Roizin'
Database: books
Question: Who authored the book with greatest number of pages?
Evidence: greatest number of pages refers to Max(num_pages); who authored refers to author_name
SQL: 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
Database: books
Question: List the email of customers that bought the book titled Switch on the Night.
Evidence: "Switch on the Night" is the title
SQL: SELECT T4.email 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 = 'Switch on the Night'
Database: books
Question: List the author's name of the books published by Abrams.
Evidence: "Abrams" is the publisher_name; author's name refers to author_name
SQL: 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 INNER JOIN publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T4.publisher_name = 'Abrams'
Database: books
Question: What is the publisher name of the book titled The Illuminati?
Evidence: "The Illuminati" is the title of book
SQL: SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.title = 'The Illuminati'
Database: books
Question: In books authored by Abraham Lincoln, what is the percentage of the books published in 1992?
Evidence: "Abraham Lincoln" is the author_name; published in 1992 refers to publication_date LIKE '1992%'; percentage = Divide (Sum(publication_date LIKE '1992%'), Count(publication_date)) * 100
SQL: SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.publication_date) = '1992' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) 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 = 'Abraham Lincoln'
Database: books
Question: Among the books published in 2004, list the name of the publisher of books with number of pages greater than 70% of the average number of pages of all books.
Evidence: published in 2004 refers to publication_date LIKE '2004%'; books with number of pages greater than 70% of the average number of pages refers to num_pages > Multiply(Avg(num_pages), 0.7); name of publisher refers to publisher_name
SQL: SELECT T1.title, T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE STRFTIME('%Y', T1.publication_date) = '2004' AND T1.num_pages * 100 > ( SELECT AVG(num_pages) FROM book ) * 70
Database: books
Question: Name the streets in Dallas.
Evidence: "Dallas" is the city; streets refers to street_name
SQL: SELECT street_name FROM address WHERE city = 'Dallas'
Database: books
Question: Which books were released by Orson Scott Card in 2001?
Evidence: "Orson Scott Card" is the author_name; released in 2001 refers to publication_date LIKE '2001%'; books refers to title
SQL: 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 = 'Orson Scott Card' AND STRFTIME('%Y', T1.publication_date) = '2001'
Database: books
Question: Count the number of books written by Orson Scott Card.
Evidence: "Orson Scott Card" is the author_name
SQL: SELECT COUNT(*) 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 = 'Orson Scott Card'
Database: books
Question: Provide the authors and titles of the books which have more than 3000 pages.
Evidence: authors refers to author_name; more than 3000 pages refers to num_pages > 3000
SQL: SELECT T3.author_name, 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 T1.num_pages > 3000
Database: books
Question: Who wrote "The Prophet"?
Evidence: "The Prophet" is the title of the book: who wrote refers to author_name
SQL: 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 Prophet'
Database: books
Question: How many books were published by Ace Hardcover?
Evidence: "Ace Hardcover" is the publisher_name
SQL: SELECT COUNT(*) FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Ace Hardcover'
Database: books
Question: Which publisher published Barry Eisler's book?
Evidence: "Barry Eisler" is the author_name; publisher refers to publisher_name
SQL: SELECT T4.publisher_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 publisher AS T4 ON T4.publisher_id = T1.publisher_id WHERE T3.author_name = 'Barry Eisler'
Database: books
Question: How many books were published in Japanese?
Evidence: published in Japanese refers to language_name = 'Japanese'
SQL: SELECT COUNT(T2.book_id) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese'
Database: books
Question: Sum the total price of the orders for The Prophet book.
Evidence: "The Prophet" is the title of the book: total price refers to Sum(price)
SQL: SELECT SUM(T1.price) FROM order_line AS T1 INNER JOIN book AS T2 ON T1.book_id = T2.book_id WHERE T2.title = 'The Prophet'
Database: books
Question: Provide the number of orders by Daisey Lamball in 2021.
Evidence: in 2021 refers to order_date LIKE '2021%'
SQL: SELECT COUNT(*) FROM cust_order AS T1 INNER JOIN customer AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = 'Daisey' AND T2.last_name = 'Lamball' AND STRFTIME('%Y', T1.order_date) = '2021'
Database: books
Question: How many customers are from Australia?
Evidence: "Australia" is the country_name;
SQL: SELECT COUNT(*) FROM customer_address AS T1 INNER JOIN address AS T2 ON T2.address_id = T1.address_id INNER JOIN country AS T3 ON T3.country_id = T2.country_id WHERE T3.country_name = 'Australia'
Database: books
Question: How many orders were delivered in December 2019?
Evidence: delivered refers to status_value = 'Delivered'; in December 2019 refers to status_date LIKE '2019-12%'
SQL: SELECT COUNT(*) FROM order_status AS T1 INNER JOIN order_history AS T2 ON T1.status_id = T2.status_id WHERE T1.status_value = 'Delivered' AND STRFTIME('%Y', T2.status_date) = '2019'
Database: books
Question: Provide the customers' names who ordered the Fantasmas.
Evidence: "Fantasmas" is the title of the book; customer names refers to first_name, last_name
SQL: 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 = 'Fantasmas'
Database: books
Question: How many percent of orders in 2020 used international shipping?
Evidence: international shipping refers to method_name = 'International'; orders in 2020 refers to order_date = '2020%'; percentage = Divide (Sum(method_name = 'International'), Count(order_id)) * 100
SQL: SELECT CAST(SUM(CASE WHEN T2.method_name = 'International' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM cust_order AS T1 INNER JOIN shipping_method AS T2 ON T1.shipping_method_id = T2.method_id WHERE STRFTIME('%Y', T1.order_date) = '2020'
Database: books
Question: List all the authors named "George".
Evidence: author named 'George' refers to author_name = 'George%'
SQL: SELECT author_name FROM author WHERE author_name LIKE 'George%'
Database: books
Question: Which year has the most customer orders?
Evidence: year with the most customer orders refers to Max(count(order_id))
SQL: SELECT strftime('%Y', order_date) FROM cust_order GROUP BY strftime('%Y', order_date) ORDER BY COUNT(strftime('%Y', order_date)) DESC LIMIT 1
Database: books
Question: What is the average price for the order line?
Evidence: average price refers to AVG(price)
SQL: SELECT AVG(price) FROM order_line
Database: books
Question: List all of the books that were published in 1995.
Evidence: published in 1995 refers to publication_date LIKE '1995%'; ; list of book refers to title
SQL: SELECT title FROM book WHERE STRFTIME('%Y', publication_date) = '1995'
Database: books
Question: What is the most common domain for the email address among all the customers?
Evidence: most common domain for the email refers to Max(Count(SUBSTR(email, CHARINDEX('@', email) + 1, length(email) - charindex('@', email))))
SQL: SELECT SUBSTR(email, INSTR(email, '@') + 1, LENGTH(email) - INSTR(email, '@')) AS ym FROM customer GROUP BY SUBSTR(email, INSTR(email, '@') + 1, LENGTH(email) - INSTR(email, '@')) ORDER BY COUNT(*) DESC LIMIT 1
Database: books
Question: How many publishers have the word "book" in their name?
Evidence: publisher have the word 'book' refers to publisher_name LIKE '%book%'
SQL: SELECT COUNT(*) FROM publisher WHERE publisher_name LIKE '%book%'
Database: books
Question: Which language is the rarest among all the books?
Evidence: language written in refers to language_name; rarest refers to Min(Count(book_id))
SQL: SELECT T2.language_name FROM book AS T1 INNER JOIN book_language AS T2 ON T1.language_id = T2.language_id GROUP BY T2.language_name ORDER BY COUNT(T2.language_name) ASC LIMIT 1
Database: books
Question: List all the order dates for the customer named "Adrian Kunzelmann".
SQL: SELECT T3.order_date 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 = 'Adrian' AND T4.last_name = 'Kunzelmann'
Database: books
Question: How many addresses are from the Philippines?
Evidence: "Philippines" is the country_name
SQL: SELECT COUNT(T2.country_id) FROM address AS T1 INNER JOIN country AS T2 ON T2.country_id = T1.country_id WHERE T2.country_name = 'Philippines'
Database: books
Question: Who is the author who wrote the most books?
Evidence: author refers to author_name; who wrote the most book refers to Max(Count(author_id))
SQL: SELECT T1.author_name FROM author AS T1 INNER JOIN book_author AS T2 ON T1.author_id = T2.author_id GROUP BY T1.author_name ORDER BY COUNT(T2.author_id) DESC LIMIT 1
Database: books
Question: What are the books published by "Harper Collins"?
Evidence: "Harper Collins" is the publisher_name; books refers to title
SQL: SELECT T1.title FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T2.publisher_name = 'Harper Collins'
Database: books
Question: How many orders were returned in the year 2020?
Evidence: returned refers to status_value = 'Returned'; in the year 2020 refers to status_date LIKE '%2020%'
SQL: 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'
Database: books
Question: What is the second-least common method of shipping?
Evidence: method of shipping refers to method_name; least method refers to Min(Count(method_id))
SQL: 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
Database: books
Question: How many of the customer addresses are inactive?
Evidence: addresses are inactive refers to address_status = 'Inactive'
SQL: 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'
Database: books
Question: What is the book with the most orders?
Evidence: books refers to title; the most orders refers to Max(Count(order_id))
SQL: 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
Database: books
Question: What is the address that received the most orders?
Evidence: address refers to street_name, city; received the most orders refers to Max(count(dest_address_id))
SQL: 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
Database: books
Question: How much time does it take to update the status of order "2398"?
Evidence: "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"
SQL: 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
Database: books
Question: Which customer has the most addresses?
Evidence: customer refers to first_name, last_name; the most address refers to Max(count(address_id))
SQL: 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