db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
books
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'
Question: how many orders were returned in the year 2020? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custome...
how many orders were returned in the year 2020?
books
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
Question: what is the second-least common method of shipping? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. cus...
what is the second-least common method of shipping?
books
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'
Question: how many of the customer addresses are inactive? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custom...
how many of the customer addresses are inactive?
books
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
Question: what is the book with the most orders? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
what is the book with the most orders?
books
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
Question: what is the address that received the most orders? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. cust...
what is the address that received the most orders?
books
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
Question: how much time does it take to update the status of order '2398'? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, co...
how much time does it take to update the status of order '2398'?
books
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
Question: which customer has the most addresses? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
which customer has the most addresses?
books
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
Question: what percentage of the total prices of all orders are shipped internationally? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_...
what percentage of the total prices of all orders are shipped internationally?
books
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 )
Question: list all the authors who wrote fewer pages than the average. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, countr...
list all the authors who wrote fewer pages than the average.
books
select min(price) from order_line where price <> 0
Question: other than zero, what is the lowest price paid by a customer for an order? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name...
other than zero, what is the lowest price paid by a customer for an order?
books
select count(address_id) from address where city = 'villeneuve-la-garenne'
Question: how many customers have an address that is located in the city of villeneuve-la-garenne? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_numbe...
how many customers have an address that is located in the city of villeneuve-la-garenne?
books
select count(*) from author where author_name like 'adam%'
Question: how many authors are named adam? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> customer_i...
how many authors are named adam?
books
select count(*) from customer where email like '%@yahoo.com'
Question: how many customers use a yahoo! mail e-mail address? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. cu...
how many customers use a yahoo! mail e-mail address?
books
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'
Question: what are the city addresses of the customers located in the united states of america? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, ...
what are the city addresses of the customers located in the united states of america?
books
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'
Question: how many orders did marcelia goering place in 2021 that uses the priority shipping method? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_num...
how many orders did marcelia goering place in 2021 that uses the priority shipping method?
books
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
Question: which books have the most expensive price? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> ...
which books have the most expensive price?
books
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'
Question: how many customers ordered the book titled 'anleitung zum zickigsein' | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, cit...
how many customers ordered the book titled 'anleitung zum zickigsein'
books
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)'
Question: what is the most expensive price paid by a customer for the book 'bite me if you can (argeneau #6)'? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, ...
what is the most expensive price paid by a customer for the book 'bite me if you can (argeneau #6)'?
books
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
Question: how many customers ordered the oldest book? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer ->...
how many customers ordered the oldest book?
books
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
Question: list all the titles of the spanish books published by alfaguara. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, co...
list all the titles of the spanish books published by alfaguara.
books
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
Question: how many customers ordered stephen king's first book? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. c...
how many customers ordered stephen king's first book?
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
Question: what are the languages of the first two published books? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id...
what are the languages of the first two published books?
books
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'
Question: who published the book 'the secret garden'? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer ->...
who published the book 'the secret garden'?
books
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'
Question: among the books that were published by scholastic, how many were written by j.k rowling? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_numbe...
among the books that were published by scholastic, how many were written by j.k rowling?
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
Question: what are the names of all the publishers who have published at least 30 books? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_...
what are the names of all the publishers who have published at least 30 books?
books
select street_number from address
Question: indicate the last number of each street. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cu...
indicate the last number of each street.
books
select street_number, street_name, city, country_id from address where city = 'lazaro cardenas'
Question: indicate the complete address of customers located in lazaro cardenas. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, ci...
indicate the complete address of customers located in lazaro cardenas.
books
select isbn13 from book where num_pages < 140 and num_pages > 135
Question: indicate the isbn13 of all the books that have less than 140 pages and more than 135. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, ...
indicate the isbn13 of all the books that have less than 140 pages and more than 135.
books
select title from book order by publication_date asc limit 6
Question: indicate the title of the six books with the greatest potential value as collectibles. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number,...
indicate the title of the six books with the greatest potential value as collectibles.
books
select count(*) from cust_order where order_date like '2020-12%'
Question: how many books were ordered in the last month of the year 2020? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, cou...
how many books were ordered in the last month of the year 2020?
books
select first_name, last_name from customer where last_name like 'k%'
Question: indicate the full name of all customers whose last name begins with the letter k. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, stre...
indicate the full name of all customers whose last name begins with the letter k.
books
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'
Question: in which cities are the customers of costa rica located? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id...
in which cities are the customers of costa rica located?
books
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'
Question: which customer addresses are no longer active? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer...
which customer addresses are no longer active?
books
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'
Question: what is the full name of the customers who live in baiyin city? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, cou...
what is the full name of the customers who live in baiyin city?
books
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'
Question: what is the email of the customers who place their orders with priority method? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street...
what is the email of the customers who place their orders with priority method?
books
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
Question: on what date did the customers who live at number 460 of their respective streets place their orders? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id,...
on what date did the customers who live at number 460 of their respective streets place their orders?
books
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'
Question: identify by their id all the orders that have been cancelled. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, count...
identify by their id all the orders that have been cancelled.
books
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%'
Question: what is the status of the orders placed on 04/10/2022? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. ...
what is the status of the orders placed on 04/10/2022?
books
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'
Question: what is the highest price at which a customer bought the book 'the prophet'? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_na...
what is the highest price at which a customer bought the book 'the prophet'?
books
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
Question: on what dates were books ordered at a price of 16.54? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. c...
on what dates were books ordered at a price of 16.54?
books
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'
Question: list the titles of all the books that peter h. smith wrote. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country...
list the titles of all the books that peter h. smith wrote.
books
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
Question: how many books under 300 pages has harpercollins publishers published? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, ci...
how many books under 300 pages has harpercollins publishers published?
books
select count(*) from book_language as t1 inner join book as t2 on t1.language_id = t2.language_id where t1.language_name = 'japanese'
Question: how many books have been published in japanese? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custome...
how many books have been published in japanese?
books
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'
Question: what is the average number of pages in the books written by jennifer crusie? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_na...
what is the average number of pages in the books written by jennifer crusie?
books
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'
Question: what percentage of the orders placed by kaleena were shipped by the international method? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_numb...
what percentage of the orders placed by kaleena were shipped by the international method?
books
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'
Question: provide the full name of the customers who have ordered the book the sorrows of young werther. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street...
provide the full name of the customers who have ordered the book the sorrows of young werther.
books
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'
Question: list every book that ursola purdy has ordered. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer...
list every book that ursola purdy has ordered.
books
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
Question: who is the author of the book with the biggest page count? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_...
who is the author of the book with the biggest page count?
books
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'
Question: how many books written by akira watanabe are available on gravity? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, ...
how many books written by akira watanabe are available on gravity?
books
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'
Question: provide the full address of ursola purdy. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> c...
provide the full address of ursola purdy.
books
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'
Question: who is the author of the book the mystery in the rocky mountains? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, c...
who is the author of the book the mystery in the rocky mountains?
books
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'
Question: identify the publisher of the book girls' night in. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. cus...
identify the publisher of the book girls' night in.
books
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
Question: name the publisher of the oldest book. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
name the publisher of the oldest book.
books
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
Question: identify the cost difference between priority and express shipping methods. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_nam...
identify the cost difference between priority and express shipping methods.
books
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'
Question: how many orders have been cancelled in 2022? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -...
how many orders have been cancelled in 2022?
books
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'
Question: list all the books published by bbc audiobooks. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custome...
list all the books published by bbc audiobooks.
books
select count(*) from book where strftime('%y', publication_date) = '2017'
Question: how many books were published in 2017? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
how many books were published in 2017?
books
select isbn13 from book where title = 'the mystery in the rocky mountains'
Question: provide the international standard book number of the book the mystery in the rocky mountains. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street...
provide the international standard book number of the book the mystery in the rocky mountains.
books
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'
Question: among all orders updated in 2022, identify the percentage that has been returned. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, stre...
among all orders updated in 2022, identify the percentage that has been returned.
books
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
Question: among all addresses provided by customers, identify the percentage that are not in use anymore. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, stree...
among all addresses provided by customers, identify the percentage that are not in use anymore.
books
select num_pages from book where title = 'seaward'
Question: how many pages does 'seaward' have? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> custome...
how many pages does 'seaward' have?
books
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'
Question: who is the author of first things first? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cu...
who is the author of first things first?
books
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'
Question: list all books authored by tom clancy. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
list all books authored by tom clancy.
books
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'
Question: which book by hirohiko araki was published on 6/6/2006? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id....
which book by hirohiko araki was published on 6/6/2006?
books
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'
Question: who is the publisher of hitchhiker's guide to the galaxy: the filming of the douglas adams classic? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, s...
who is the publisher of hitchhiker's guide to the galaxy: the filming of the douglas adams classic?
books
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'
Question: list all books published by adv manga. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cust...
list all books published by adv manga.
books
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'
Question: write the full name of the customers whose address is at 55 dorton pass, huangqiao. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, st...
write the full name of the customers whose address is at 55 dorton pass, huangqiao.
books
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'
Question: which country is 9 green ridge point, arendal located at? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_i...
which country is 9 green ridge point, arendal located at?
books
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
Question: list 10 addresses located in poland. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> custom...
list 10 addresses located in poland.
books
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'
Question: what is the shipping method ordered by nicolette sadler at 6/29/2020 7:40:07 pm? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, stree...
what is the shipping method ordered by nicolette sadler at 6/29/2020 7:40:07 pm?
books
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'
Question: list all books written in arabic. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> customer_...
list all books written in arabic.
books
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'
Question: which language is 'el plan infinito' written in? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custom...
which language is 'el plan infinito' written in?
books
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 ...
Question: what percentage of books written by hirohiko make up the number of books published by viz media? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, stre...
what percentage of books written by hirohiko make up the number of books published by viz media?
books
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'
Question: what is the average number of book pages written by zilpha keatley snyder? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name...
what is the average number of book pages written by zilpha keatley snyder?
books
select first_name, last_name from customer where email = 'ckupis4@tamu.edu'
Question: what is the full name of customer with email ckupis4@tamu.edu? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, coun...
what is the full name of customer with email ckupis4@tamu.edu?
books
select title from book order by num_pages desc limit 1
Question: which book has the most number of pages? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> cu...
which book has the most number of pages?
books
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'
Question: how many books were written by author a.j. ayer? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custom...
how many books were written by author a.j. ayer?
books
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'
Question: name the title of books written by author a.j.ayer. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. cus...
name the title of books written by author a.j.ayer.
books
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'
Question: the book name 'the season: a candid look at broadway' was published by which publisher? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number...
the book name 'the season: a candid look at broadway' was published by which publisher?
books
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'
Question: what is the average of english books among all books published by carole marsh mysteries? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_numb...
what is the average of english books among all books published by carole marsh mysteries?
books
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
Question: name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher free press. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. addre...
name the title of the book with the most number of pages that was published from 1990 to 2000 by publisher free press.
books
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'
Question: what is the order price of the book 'the servant leader' in 2003? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, c...
what is the order price of the book 'the servant leader' in 2003?
books
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'
Question: what is the current address of customer kandy? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer...
what is the current address of customer kandy?
books
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'
Question: how many books were ordered by customer kandy adamec? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. c...
how many books were ordered by customer kandy adamec?
books
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'
Question: how many orders got returned in 2022? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer -> custo...
how many orders got returned in 2022?
books
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'
Question: which country does the customer with the email 'rturbitt2@geocities.jp' from? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_n...
which country does the customer with the email 'rturbitt2@geocities.jp' from?
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
Question: name the publisher who published the most books. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custom...
name the publisher who published the most books.
books
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
Question: what is the title of the first book that was written by a.j. ayer? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, ...
what is the title of the first book that was written by a.j. ayer?
books
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'
Question: what is the percentage of books that cost greater than $10 and were ordered by customer ruthanne vatini? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_...
what is the percentage of books that cost greater than $10 and were ordered by customer ruthanne vatini?
books
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'
Question: list the title of books published by ak press. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer...
list the title of books published by ak press.
books
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
Question: who ordered the book with the cheapest price? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. customer ...
who ordered the book with the cheapest price?
books
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'
Question: list down the isbn of the books purchased by the customer with an email of fsier3e@ihg.com. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_nu...
list down the isbn of the books purchased by the customer with an email of fsier3e@ihg.com.
books
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
Question: give the author's name of the books that cost 19 dollars and above. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city,...
give the author's name of the books that cost 19 dollars and above.
books
select t2.publisher_name from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t1.isbn13 = 76092025986
Question: provide the publisher name of the book with isbn 76092025986. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, count...
provide the publisher name of the book with isbn 76092025986.
books
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
Question: among the books published by birlinn in 2008, how many books have pages around 600 to 700? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_num...
among the books published by birlinn in 2008, how many books have pages around 600 to 700?
books
select t2.price from book as t1 inner join order_line as t2 on t1.book_id = t2.book_id where t1.isbn13 = 9780763628321
Question: what is the price of the book with isbn 9780763628321? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. ...
what is the price of the book with isbn 9780763628321?
books
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
Question: what is the number of pages of the book in the order id 1167? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, count...
what is the number of pages of the book in the order id 1167?
books
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'
Question: provide the title of the books published in british-english. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, countr...
provide the title of the books published in british-english.
books
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'
Question: how many books were published by brava in 2006? | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_id. custome...
how many books were published by brava in 2006?
books
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
Question: provide the isbn and price of the book with book id 7160. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_name. address -> address_id, street_number, street_name, city, country_i...
provide the isbn and price of the book with book id 7160.