input
stringlengths
122
2.7k
output
stringlengths
24
805
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write me a SQL statement that answers the following question: How many orders were retur...
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';
[INST] Here is a database schema: shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] Please write me a SQL statement that answers ...
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;
[INST] Here is a database schema: address_status : status_id [ INTEGER ] primary_key address_status [ TEXT ] customer_address : customer_id [ INTEGER ] customer_address.customer_id = customer.customer_id address_id [ INTEGER ] customer_address.address_id = address.address_id status_id [ INTEGER ] Please write me a SQL...
SELECT COUNT(*) FROM customer_address AS T1 INNER JOIN address_status AS T2 ON T1.status_id = T2.status_id WHERE T2.address_status = 'Inactive';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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;
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEG...
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;
[INST] Here is a database schema: cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write ...
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;
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] customer_address : customer_id [ INTEGER ] customer_address.customer_id = customer.customer_id address_id [ INTEGER ] customer_address.address_id = address.address_id status_id [ INTEGE...
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;
[INST] Here is a database schema: shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_line : line_id [ INTEGER ] primary_key o...
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;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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 );
[INST] Here is a database schema: order_line : line_id [ INTEGER ] primary_key order_id [ INTEGER ] book_id [ INTEGER ] price [ REAL ] Please write me a SQL statement that answers the following question: Other than zero, what is the lowest price paid by a customer for an order? [/INST] [/INST]
SELECT MIN(price) FROM order_line WHERE price <> 0;
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the following question: How many customers have an address that is located...
SELECT COUNT(address_id) FROM address WHERE city = 'Villeneuve-la-Garenne';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] Please write me a SQL statement that answers the following question: How many authors are named Adam? [/INST] [/INST]
SELECT COUNT(*) FROM author WHERE author_name LIKE 'Adam%';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] Please write me a SQL statement that answers the following question: How many customers use a Yahoo! Mail e-mail address? [/INST] [/INST]
SELECT COUNT(*) FROM customer WHERE email LIKE '%@yahoo.com';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the fol...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] ship...
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';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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)';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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;
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = bo...
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;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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;
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] p...
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;
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages ...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the following question: Indicate the last number of each street. [/INST] [...
SELECT street_number FROM address;
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the following question: Indicate the complete address of customers located...
SELECT street_number, street_name, city, country_id FROM address WHERE city = 'Lazaro Cardenas';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT isbn13 FROM book WHERE num_pages < 140 AND num_pages > 135;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT title FROM book ORDER BY publication_date ASC LIMIT 6;
[INST] Here is a database schema: cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] Please write me a SQL statement that answers the following question: How many books were ordered in the last month of the year 2020?...
SELECT COUNT(*) FROM cust_order WHERE order_date LIKE '2020-12%';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] Please write me a SQL statement that answers the following question: Indicate the full name of all customers whose last name begins with the letter K. [/INST] [/INST]
SELECT first_name, last_name FROM customer WHERE last_name LIKE 'K%';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the fol...
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';
[INST] Here is a database schema: address_status : status_id [ INTEGER ] primary_key address_status [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer_address : customer_id [ INTEGER ] cu...
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';
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] customer_address : ...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] ship...
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';
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEG...
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;
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write me a SQL statement that answers the following question: Identify by their id all t...
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';
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_history : history_id [ INTEGER ] primary_key order_id [ ...
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%';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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';
[INST] Here is a database schema: cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_line : line_id [ INTEGER ] primary_key order_id [ INTEGER ] book_id [ INTEGER ] price [ REAL ] Please write me a SQL statement...
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;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] p...
SELECT COUNT(*) FROM book_language AS T1 INNER JOIN book AS T2 ON T1.language_id = T2.language_id WHERE T1.language_name = 'Japanese';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] ship...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book_author : book_id [ INTEGER ] book_author.book_id = book.book_id author_id [ INTEGER ] book_author.author_id = author.author_id Please write me a SQL statement that answers the following question: How many books writt...
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';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer : customer_id [ INTEGER ] primary_key first_...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] Please write me a SQL statement that answers the following question: Identify the cost difference between Priority and Express shipping methods. [/INST] [/INST]
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;
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write me a SQL statement that answers the following question: How many orders have been ...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT COUNT(*) FROM book WHERE STRFTIME('%Y', publication_date) = '2017';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT isbn13 FROM book WHERE title = 'The Mystery in the Rocky Mountains';
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write me a SQL statement that answers the following question: Among all orders updated i...
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';
[INST] Here is a database schema: address_status : status_id [ INTEGER ] primary_key address_status [ TEXT ] customer_address : customer_id [ INTEGER ] customer_address.customer_id = customer.customer_id address_id [ INTEGER ] customer_address.address_id = address.address_id status_id [ INTEGER ] Please write me a SQL...
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;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT num_pages FROM book WHERE title = 'Seaward';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] customer_address : ...
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';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the fol...
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';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id Please write me a SQL statement that answers the fol...
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;
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] shipping_method : method_id [ INTEGER ] primary_key method_name [ TEXT ] cost [ REAL ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] ship...
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';
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] p...
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';
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] p...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages ...
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 ...
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] Please write me a SQL statement that answers the following question: What is the full name of customer with email ckupis4@tamu.edu? [/INST] [/INST]
SELECT first_name, last_name FROM customer WHERE email = 'ckupis4@tamu.edu';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id Please write me a SQL statemen...
SELECT title FROM book ORDER BY num_pages DESC LIMIT 1;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book_author : book_id [ INTEGER ] book_author.book_id = book.book_id author_id [ INTEGER ] book_author.author_id = author.author_id Please write me a SQL statement that answers the following question: How many books were ...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = bo...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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';
[INST] Here is a database schema: address_status : status_id [ INTEGER ] primary_key address_status [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer : customer_id [ INTEGER ] primary_ke...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_line : line_id [ INTEGER ]...
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';
[INST] Here is a database schema: order_status : status_id [ INTEGER ] primary_key status_value [ TEXT ] order_history : history_id [ INTEGER ] primary_key order_id [ INTEGER ] status_id [ INTEGER ] status_date [ DATETIME ] Please write me a SQL statement that answers the following question: How many orders got return...
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';
[INST] Here is a database schema: country : country_id [ INTEGER ] primary_key country_name [ TEXT ] address : address_id [ INTEGER ] primary_key street_number [ TEXT ] street_name [ TEXT ] city [ TEXT ] country_id [ INTEGER ] address.country_id = country.country_id customer : customer_id [ INTEGER ] primary_key first_...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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;
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_line : line_id [ INTEGER ]...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] cust_order : order_id [ INTEGER ] primary_key order_date [ DATETIME ] customer_id [ INTEGER ] shipping_method_id [ INTEGER ] dest_address_id [ INTEGER ] order_line : line_id [ INTEGER ]...
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;
[INST] Here is a database schema: customer : customer_id [ INTEGER ] primary_key first_name [ TEXT ] last_name [ TEXT ] email [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ...
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';
[INST] Here is a database schema: author : author_id [ INTEGER ] primary_key author_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publi...
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;
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
SELECT T2.publisher_name FROM book AS T1 INNER JOIN publisher AS T2 ON T1.publisher_id = T2.publisher_id WHERE T1.isbn13 = 76092025986;
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
SELECT T2.price FROM book AS T1 INNER JOIN order_line AS T2 ON T1.book_id = T2.book_id WHERE T1.isbn13 = 9780763628321;
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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;
[INST] Here is a database schema: book_language : language_id [ INTEGER ] primary_key language_code [ TEXT ] language_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] p...
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';
[INST] Here is a database schema: publisher : publisher_id [ INTEGER ] primary_key publisher_name [ TEXT ] book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] b...
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';
[INST] Here is a database schema: book : book_id [ INTEGER ] primary_key title [ TEXT ] isbn13 [ TEXT ] language_id [ INTEGER ] book.language_id = book_language.language_id num_pages [ INTEGER ] publication_date [ DATE ] publisher_id [ INTEGER ] book.publisher_id = publisher.publisher_id order_line : line_id [ INTEGER ...
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;