db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
airline
select t2.dest from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description = 'southeast alaska airlines: web'
Question: what are the destinations of the flights with air carrier description 'southeast alaska airlines: web'? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN_CITY_MAR...
what are the destinations of the flights with air carrier description 'southeast alaska airlines: web'?
airline
select count(*) from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description = 'spirit air lines: nk' and t2.cancelled = 0 and t2.fl_date between '2018/8/10' and '2018/8/20'
Question: from august 10 to august 20, 2018, how many cancelled flights of air carrier named spirit air lines: nk are there? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIG...
from august 10 to august 20, 2018, how many cancelled flights of air carrier named spirit air lines: nk are there?
airline
select count(*) from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description like '%horizon air%' and t2.fl_date = '2018/8/2'
Question: what is the total number of flights that flew on august 2, 2018 with air carrier described as horizon air? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN_CITY_...
what is the total number of flights that flew on august 2, 2018 with air carrier described as horizon air?
airline
select t2.tail_num from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t2.arr_time <= 1000 and t1.description = 'iscargo hf: icq'
Question: what is the tail number of the flight with air carrier named iscargo hf: icq and arrival time of 1000 and below? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN...
what is the tail number of the flight with air carrier named iscargo hf: icq and arrival time of 1000 and below?
airline
select t2.fl_date from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t2.actual_elapsed_time < 100 and t1.description = 'profit airlines inc.: xbh'
Question: list the flight date of flights with air carrier described as profit airlines inc.: xbh which have an actual elapsed time below 100. | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AI...
list the flight date of flights with air carrier described as profit airlines inc.: xbh which have an actual elapsed time below 100.
airline
select count(*) from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description like '%republic airline%' and t2.dep_delay > 30
Question: among the flights with air carrier named republic airline, how many of the flights have departure delay of 30 minutes and above? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPOR...
among the flights with air carrier named republic airline, how many of the flights have departure delay of 30 minutes and above?
airline
select t1.description from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t2.fl_date = '2018/8/25' group by t1.description
Question: what are the air carriers of the flights that flew on august 25, 2018 that have departure delay of -5? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN_CITY_MARK...
what are the air carriers of the flights that flew on august 25, 2018 that have departure delay of -5?
airline
select t2.description from airlines as t1 inner join `air carriers` as t2 on t2.code = t1.op_carrier_airline_id where t1.tail_num = 'n922us' and t1.origin = 'phx' group by t2.description
Question: provide the air carrier description of the flight with a tail number n922us from phoenix. | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN_CITY_MARKET_ID, ORIGIN...
provide the air carrier description of the flight with a tail number n922us from phoenix.
airline
select t1.description from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t2.arr_delay < 0 and t2.dep_delay < 0 group by t1.description
Question: give the air carrier description of the flights that have an earlier arrival and departure. | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRPORT_SEQ_ID, ORIGIN_CITY_MARKET_ID, ORIG...
give the air carrier description of the flights that have an earlier arrival and departure.
airline
select t2.tail_num from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description = 'southwest airlines co.: wn' and t2.actual_elapsed_time < ( select avg(actual_elapsed_time) * 0.8 from airlines )
Question: among the flights with air carrier 'southwest airlines co.: wn', provide the tail number of flights with an actual elapsed time lower than the 80% of the average actual elapsed time of listed flights. | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_A...
among the flights with air carrier 'southwest airlines co.: wn', provide the tail number of flights with an actual elapsed time lower than the 80% of the average actual elapsed time of listed flights.
airline
select t1.description from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t2.dest = 'phx' and t2.arr_time < ( select avg(arr_time) * 0.4 from airlines ) group by t1.description
Question: list the air carrier's description with arrival time lower than the 40% of the average arrival time of flights that flew to phoenix. | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AI...
list the air carrier's description with arrival time lower than the 40% of the average arrival time of flights that flew to phoenix.
airline
select cast(sum(case when t2.dep_delay < 0 then 1 else 0 end) as real) * 100 / count(*) from `air carriers` as t1 inner join airlines as t2 on t1.code = t2.op_carrier_airline_id where t1.description like '%american airlines%'
Question: among the flights of the air carrier described as american airlines, what is the percentage of the flights with earlier departure? | Tables: Air Carriers -> Code, Description. Airports -> Code, Description. Airlines -> FL_DATE, OP_CARRIER_AIRLINE_ID, TAIL_NUM, OP_CARRIER_FL_NUM, ORIGIN_AIRPORT_ID, ORIGIN_AIRP...
among the flights of the air carrier described as american airlines, what is the percentage of the flights with earlier departure?
books
select count(*) from book where publisher_id = 1929 and num_pages > 500
Question: among the books published by publisher id 1929, how many of them have over 500 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, ...
among the books published by publisher id 1929, how many of them have over 500 pages?
books
select publication_date from book order by num_pages desc limit 1
Question: what is the publication date of the book with the most 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, count...
what is the publication date of the book with the most pages?
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 illuminati'
Question: what is the name of the publisher of the book 'the illuminati'? | 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 name of the publisher of the book 'the illuminati'?
books
select count(*) from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t2.publisher_name = 'thomas nelson'
Question: how many books were published by publisher 'thomas nelson'? | 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...
how many books were published by publisher 'thomas nelson'?
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(t1.book_id) desc limit 1
Question: what is the name of the publisher that has published the most number of 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 is the name of the publisher that has published the most number of books?
books
select t1.title from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t2.publisher_name = 'thomas nelson' order by t1.publication_date asc limit 1
Question: please give the title of the oldest book published by publisher 'thomas nelson'. | 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...
please give the title of the oldest book published by publisher 'thomas nelson'.
books
select count(*) from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t2.publisher_name = 'thomas nelson' and t1.num_pages > 300
Question: among the books published by publisher 'thomas nelson', how many of them have over 300 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_...
among the books published by publisher 'thomas nelson', how many of them have over 300 pages?
books
select t2.publisher_name from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id order by t1.num_pages desc limit 1
Question: what is the name of the publisher of the book with the most 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, ...
what is the name of the publisher of the book with the most pages?
books
select count(*) from book as t1 inner join book_language as t2 on t1.language_id = t2.language_id where t2.language_name = 'english'
Question: how many books are in 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, country_id. customer -> customer_id,...
how many books are in english?
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 = 'british english'
Question: please list the titles of all the books 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, country...
please list the titles of all the books in british english.
books
select min(t2.price) from book as t1 inner join order_line as t2 on t1.book_id = t2.book_id where t1.title = 'the little house'
Question: what is the cheapest order price of the book 'the little house'? | 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...
what is the cheapest order price of the book 'the little house'?
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 = 'lucas' and t4.last_name = 'wyldbore'
Question: please list the titles of all the books that lucas wyldbore 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, ...
please list the titles of all the books that lucas wyldbore has ordered.
books
select count(*) 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 = 'lucas' and t4.last_name = 'wyldbore' and t1.num_pages > 300
Question: among the books ordered by lucas wyldbore, how many of them are over 300 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...
among the books ordered by lucas wyldbore, how many of them are over 300 pages?
books
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'
Question: what is the total price of all the books ordered by lucas wyldbore? | 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 total price of all the books ordered by lucas wyldbore?
books
select sum(t1.price) / 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 = 'lucas' and t3.last_name = 'wyldbore'
Question: how much money on average does lucas wyldbore spend on book 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,...
how much money on average does lucas wyldbore spend on book orders?
books
select cast(sum(case when t1.price > 13 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 = 'lucas' and t3.last_name = 'wyldbore'
Question: among the books ordered by lucas wyldbore, what is the percentage of those books over $13? | 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 ordered by lucas wyldbore, what is the percentage of those books over $13?
books
select city from address where address_id = 547
Question: which city does the address id 547 belong to? | 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 city does the address id 547 belong to?
books
select count(*) from customer as t1 inner join cust_order as t2 on t1.customer_id = t2.customer_id where t1.first_name = 'cordy' and t1.last_name = 'dumbarton'
Question: how many orders has cordy dumbarton made? | 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...
how many orders has cordy dumbarton made?
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 = 'japanese' order by t1.publication_date asc limit 1
Question: list the title of the earliest published japanese 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....
list the title of the earliest published japanese book.
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: for the publisher which published the most books, show its name. | 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...
for the publisher which published the most books, show its name.
books
select count(t1.book_id) from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t2.publisher_name = 'kensington'
Question: how many books were published by kensington? | 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 books were published by kensington?
books
select t2.language_name from book as t1 inner join book_language as t2 on t1.language_id = t2.language_id where t1.book_id = 1405
Question: which language was book id 1405 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. customer ->...
which language was book id 1405 written in?
books
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
Question: which customer has made the most orders? show his/her full name. | 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...
which customer has made the most orders? show his/her full name.
books
select t1.title from book as t1 inner join order_line as t2 on t1.book_id = t2.book_id group by t1.title order by count(t1.title) desc limit 1
Question: name the book title of the bestseller. | 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 book title of the bestseller.
books
select count(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 = 'david foster wallace'
Question: how many books did david foster wallace write? | 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 books did david foster wallace write?
books
select count(*) from book as t1 inner join order_line as t2 on t1.book_id = t2.book_id where t1.title = 'o xar'
Question: how many orders does the book 'o xar' 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 ->...
how many orders does the book 'o xar' have?
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.first_name = 'malina' and t1.last_name = 'johnson' and t2.status_id = 2
Question: which country does malina johnson live 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. customer -> ...
which country does malina johnson live in?
books
select count(*) from country as t1 inner join address as t2 on t1.country_id = t2.country_id where t1.country_name = 'ukraine'
Question: give the number of ukrainian addresses in the database. | 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....
give the number of ukrainian addresses in the database.
books
select t1.country_name from country as t1 inner join address as t2 on t1.country_id = t2.country_id where t2.city = 'irovnica'
Question: which country does irovnica city belong to? | 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 country does irovnica city belong to?
books
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%'
Question: calculate the percentage of the international shipping orders on 2022/11/10. | 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...
calculate the percentage of the international shipping orders on 2022/11/10.
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 = 'david coward'
Question: what is the average number of pages of david coward's 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, countr...
what is the average number of pages of david coward's books?
books
select method_name from shipping_method order by cost asc limit 1
Question: what is the cost of the slowest and least expensive 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_number, street_name, city...
what is the cost of the slowest and least expensive shipping method?
books
select title from book where strftime('%y', publication_date) = '1900' order by publication_date limit 1
Question: what is the title of the first book that was published in 1900? | 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 title of the first book that was published in 1900?
books
select first_name, last_name from customer where email = 'aalleburtonkc@yellowbook.com'
Question: what is the full name of the customer who owns the 'aalleburtonkc@yellowbook.com' 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, str...
what is the full name of the customer who owns the 'aalleburtonkc@yellowbook.com' e-mail address?
books
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'
Question: how many orders in 2022 have iran as their destinations? | 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...
how many orders in 2022 have iran as their destinations?
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 = 'daisey' and t1.last_name = 'lamball' and t3.method_name = 'international'
Question: among daisey lamball's orders, how many were shipped via international 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, stree...
among daisey lamball's orders, how many were shipped via international shipping?
books
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
Question: what is the full name of the customer who ordered the most books of all time? | 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...
what is the full name of the customer who ordered the most books of all time?
books
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'
Question: how many orders did antonia poltun return? | 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 did antonia poltun return?
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) desc limit 1
Question: which shipping method is preferred by customers the most? | 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 shipping method is preferred by customers the most?
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 = 'delivered' and strftime('%y', t2.status_date) = '2021'
Question: how many orders were delivered in 2021? | 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 -> cus...
how many orders were delivered in 2021?
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 = 'j.k. rowling' order by t1.publication_date asc limit 1
Question: what is the name of the first book 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_number, street_name, city, country_...
what is the name of the first book written by j.k rowling?
books
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'
Question: how many books did a.r. braunmuller write? | 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 books did a.r. braunmuller write?
books
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
Question: what is the name of the publisher who published agatha christie'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_n...
what is the name of the publisher who published agatha christie's first book?
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 = 'danielle steel'
Question: list all the names of the books written by danielle steel. | 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 all the names of the books written by danielle steel.
books
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'
Question: how many books by william shakespeare were published by penguin classics? | 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,...
how many books by william shakespeare were published by penguin classics?
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: what is the name of the publisher that 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, co...
what is the name of the publisher that published the most books?
books
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'
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. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. country -> country_id, country_...
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.
books
select publisher_name from publisher where publisher_id = 22
Question: what is the name of the publisher with publisher id 22? | 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 name of the publisher with publisher id 22?
books
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
Question: how many of the books authored by al gore have less than 400 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,...
how many of the books authored by al gore have less than 400 pages?
books
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'
Question: list the author's and publisher's name of the book published on july 10, 1997. | 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_...
list the author's and publisher's name of the book published on july 10, 1997.
books
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
Question: what is the language of the book with isbn 23755004321? | 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 language of the book with isbn 23755004321?
books
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
Question: what is the title of the most expensive 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 ...
what is the title of the most expensive book?
books
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'
Question: calculate the total price of books ordered by customer named lucas wyldbore. | 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...
calculate the total price of books ordered by customer named lucas wyldbore.
books
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'
Question: list the isbn of the book published in spanish. | 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 the isbn of the book published in spanish.
books
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
Question: among the books that cost less than 1 dollar, how many were published by berkley trade? | 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...
among the books that cost less than 1 dollar, how many were published by berkley trade?
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 = 'zia' and t4.last_name = 'roizin'
Question: list the title of the books purchased by the customer named zia roizin. | 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, c...
list the title of the books purchased by the customer named zia roizin.
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 authored the book with greatest 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. cu...
who authored the book with greatest number of pages?
books
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'
Question: list the email of customers that bought the book titled switch on the night. | 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...
list the email of customers that bought the book titled switch on the night.
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 inner join publisher as t4 on t4.publisher_id = t1.publisher_id where t4.publisher_name = 'abrams'
Question: list the author's name of the books published by abrams. | 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...
list the author's name of the books published by abrams.
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 illuminati'
Question: what is the publisher name of the book titled the illuminati? | 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 publisher name of the book titled the illuminati?
books
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'
Question: in books authored by abraham lincoln, what is the percentage of the books published in 1992? | 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_n...
in books authored by abraham lincoln, what is the percentage of the books published in 1992?
books
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
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. | Tables: address_status -> status_id, address_status. author -> author_id, author_name. book_language -> language_id, language_code, language_name. cou...
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.
books
select email from customer where first_name = 'moss' and last_name = 'zarb'
Question: provide the contact email of moss zarb. | 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 -> cus...
provide the contact email of moss zarb.
books
select street_name from address where city = 'dallas'
Question: name the streets in dallas. | 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_id, fi...
name the streets in dallas.
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 = 'orson scott card' and strftime('%y', t1.publication_date) = '2001'
Question: which books were released by orson scott card in 2001? | 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 books were released by orson scott card in 2001?
books
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'
Question: count the number of books written by orson scott card. | 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. ...
count the number of books written by orson scott card.
books
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
Question: provide the authors and titles of the books which have more than 3000 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_na...
provide the authors and titles of the books which have more than 3000 pages.
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 prophet'
Question: who wrote '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_name, city, country_id. customer -> customer_id, first...
who wrote 'the prophet'?
books
select count(*) from book as t1 inner join publisher as t2 on t1.publisher_id = t2.publisher_id where t2.publisher_name = 'ace hardcover'
Question: how many books were published by ace hardcover? | 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 ace hardcover?
books
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'
Question: which publisher published barry eisler's 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...
which publisher published barry eisler's book?
books
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'
Question: how many books were 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. customer -> ...
how many books were published in japanese?
books
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'
Question: sum the total price of the orders for the prophet 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....
sum the total price of the orders for the prophet book.
books
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'
Question: provide the number of orders by daisey lamball in 2021. | 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....
provide the number of orders by daisey lamball in 2021.
books
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'
Question: how many customers are from australia? | 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 customers are from australia?
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 = 'delivered' and strftime('%y', t2.status_date) = '2019'
Question: how many orders were delivered in december 2019? | 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 orders were delivered in december 2019?
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 = 'fantasmas'
Question: provide the customers' names who ordered the fantasmas. | 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....
provide the customers' names who ordered the fantasmas.
books
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'
Question: how many percent of orders in 2020 used international 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, cou...
how many percent of orders in 2020 used international shipping?
books
select author_name from author where author_name like 'george%'
Question: list all the authors named 'george'. | 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 all the authors named 'george'.
books
select strftime('%y', order_date) from cust_order group by strftime('%y', order_date) order by count(strftime('%y', order_date)) desc limit 1
Question: which year has the most customer 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 -> cu...
which year has the most customer orders?
books
select avg(price) from order_line
Question: what is the average price for the order line? | 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 average price for the order line?
books
select title from book where strftime('%y', publication_date) = '1995'
Question: list all of the books that were published in 1995. | 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...
list all of the books that were published in 1995.
books
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
Question: what is the most common domain for the email address among all the customers? | 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...
what is the most common domain for the email address among all the customers?
books
select count(*) from publisher where publisher_name like '%book%'
Question: how many publishers have the word 'book' in their name? | 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....
how many publishers have the word 'book' in their name?
books
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
Question: which language is the rarest among all the 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. custo...
which language is the rarest among all the books?
books
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'
Question: list all the order dates for the customer named 'adrian kunzelmann'. | 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...
list all the order dates for the customer named 'adrian kunzelmann'.
books
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'
Question: how many addresses are from the philippines? | 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 addresses are from the philippines?
books
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
Question: who is the author who wrote 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. customer ->...
who is the author who wrote the most books?
books
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'
Question: what are the books published by 'harper collins'? | 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. custo...
what are the books published by 'harper collins'?