Database schema:
CREATE TABLE Client (
  IdClient TEXT PRIMARY KEY,
  Name TEXT,
  Address TEXT,
  NumCC TEXT
);
CREATE TABLE Orders (
  IdOrder TEXT PRIMARY KEY,
  IdClient TEXT,
  DateOrder TIME,
  DateExped TIME
);
CREATE TABLE Author (
  idAuthor NUMBER PRIMARY KEY,
  Name TEXT
);
CREATE TABLE Book (
  ISBN TEXT PRIMARY KEY,
  Title TEXT,
  Author TEXT,
  PurchasePrice NUMBER,
  SalePrice NUMBER
);
CREATE TABLE Author_Book (
  ISBN TEXT PRIMARY KEY,
  Author NUMBER,
  FOREIGN KEY (ISBN) REFERENCES Book(ISBN)
);
CREATE TABLE Books_Order (
  ISBN TEXT PRIMARY KEY,
  IdOrder TEXT,
  amount NUMBER,
  FOREIGN KEY (IdOrder) REFERENCES Orders(IdOrder),
  FOREIGN KEY (ISBN) REFERENCES Book(ISBN)
);

Question: What is the name of the client with the most number of orders?
SQL: SELECT T2.name FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient GROUP BY T1.idClient ORDER BY count(*) DESC LIMIT 1

Question: Show all client names and the number of orders each has made.
SQL: SELECT T2.name ,  count(*) FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient GROUP BY T1.idClient

Question: Show all book isbns and the numbers of orders for each.
SQL: SELECT isbn ,  count(*) FROM Books_Order GROUP BY isbn

Question: How many authors are there?
SQL: SELECT count(*) FROM Author

Question: What are the isbns of books ordered by both clients named Peter Doe and James Smith?
SQL: SELECT T2.isbn FROM Orders AS T1 JOIN Books_Order AS T2 ON T1.idOrder  =  T2.idOrder JOIN Client AS T3 ON T1.idClient  =  T3.idClient WHERE T3.name  =  "Peter Doe" INTERSECT SELECT T2.isbn FROM Orders AS T1 JOIN Books_Order AS T2 ON T1.idOrder  =  T2.idOrder JOIN Client AS T3 ON T1.idClient  =  T3.idClient WHERE T3.name  =  "James Smith"

Question: Show the book title corresponding to the book with the most number of orders.
SQL: SELECT T2.title FROM Books_Order AS T1 JOIN Book AS T2 ON T1.isbn  =  T2.isbn GROUP BY T1.isbn ORDER BY count(*) DESC LIMIT 1

Question: Show all book isbns and the total amount ordered for each.
SQL: SELECT isbn ,  sum(amount) FROM Books_Order GROUP BY isbn

Question: What is the maximum and the minimum sale price?
SQL: SELECT max(saleprice) ,  min(saleprice) FROM Book

Question: What are the isbns for all books, and what is the total amount ordered for each?
SQL: SELECT isbn ,  sum(amount) FROM Books_Order GROUP BY isbn

Question: What are the ids of all orders and the corresponding client names?
SQL: SELECT T1.idOrder ,  T2.name FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient

Question: Count the number of authors.
SQL: SELECT count(*) FROM Author

Question: What is the title of the book written by George Orwell that has the lowest sale price?
SQL: SELECT T1.title FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name  =  "George Orwell" ORDER BY T1.saleprice LIMIT 1

Question: Who is the author of the book "Pride and Prejudice"?
SQL: SELECT T3.name FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T1.title  =  "Pride and Prejudice"

Question: What are the names of all the clients, and the total amount of books ordered by each?
SQL: SELECT T2.name ,  sum(T3.amount) FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient JOIN Books_Order AS T3 ON T3.idOrder  =  T1.idOrder GROUP BY T1.idClient

Question: Give the average sale price of books authored by George Orwell.
SQL: SELECT avg(saleprice) FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name  =  "George Orwell"

Question: What are the titles, ISBNs, and sale prices for all books?
SQL: SELECT title ,  isbn ,  SalePrice FROM Book

Question: Give the average purchase price and average sale price for books.
SQL: SELECT avg(purchaseprice) ,  avg(saleprice) FROM Book

Question: Show all Client names and their addresses.
SQL: SELECT name ,  address FROM Client

Question: How many orders do we have for "Pride and Prejudice"?
SQL: SELECT count(*) FROM Book AS T1 JOIN Books_Order AS T2 ON T1.isbn  =  T2.isbn WHERE T1.title  =  "Pride and Prejudice"

Question: What is the average sale price of books written by George Orwell?
SQL: SELECT avg(saleprice) FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name  =  "George Orwell"

Question: What are the names of all the authors?
SQL: SELECT name FROM Author

Question: Show ids for orders including both "Pride and Prejudice" and "The Little Prince".
SQL: SELECT idOrder FROM Book AS T1 JOIN Books_Order AS T2 ON T1.isbn  =  T2.isbn WHERE T1.title  =  "Pride and Prejudice" INTERSECT SELECT idOrder FROM Book AS T1 JOIN Books_Order AS T2 ON T1.isbn  =  T2.isbn WHERE T1.title  =  "The Little Prince"

Question: List all Book titles, ISBNs, and sale prices.
SQL: SELECT title ,  isbn ,  SalePrice FROM Book

Question: Show the names of clients who have ordered at least once.
SQL: SELECT DISTINCT T1.name FROM Client AS T1 JOIN Orders AS T2 ON T1.idClient  =  T2.idClient

Question: What is the name of the client who has ordered the greatest total amount of books?
SQL: SELECT T2.name FROM Orders AS T1 JOIN Client AS T2 ON T1.idClient  =  T2.idClient JOIN Books_Order AS T3 ON T3.idOrder  =  T1.idOrder GROUP BY T1.idClient ORDER BY sum(T3.amount) DESC LIMIT 1

Question: What are the names of all the authors, and how many books has each written?
SQL: SELECT T1.name ,  count(*) FROM Author AS T1 JOIN Author_Book AS T2 ON T1.idAuthor  =  T2.Author GROUP BY T1.idAuthor

Question: What are the titles of books that have a sale price equal to the lowest sale price across all books ?
SQL: select title from book order by saleprice asc limit 1

Question: List all book titles which have highest purchase prices .
SQL: select title from book order by purchaseprice  desc limit 1

Question: Return the sale prices of books authored by Plato.
SQL: SELECT saleprice FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name  =  "Plato"

Question: What is the maximum difference between the sale price and purchase price?
SQL: SELECT max(saleprice - purchaseprice) FROM Book

Question: What are the names and addressed of all clients, ordered alphabetically by name?
SQL: SELECT name ,  address FROM Client ORDER BY name

Question: Return the number of orders received for Pride and Prejudice.
SQL: SELECT count(*) FROM Book AS T1 JOIN Books_Order AS T2 ON T1.isbn  =  T2.isbn WHERE T1.title  =  "Pride and Prejudice"

Question: What are the names of the different clients who have made an order?
SQL: SELECT DISTINCT T1.name FROM Client AS T1 JOIN Orders AS T2 ON T1.idClient  =  T2.idClient

Question: What is the title and purchase price of the book that has the highest total order amount?
SQL: SELECT T2.title ,  T2.PurchasePrice FROM Books_Order AS T1 JOIN BOOk AS T2 ON T1.isbn  =  T2.isbn GROUP BY T1.isbn ORDER BY sum(amount) DESC LIMIT 1

Question: List titles of all books published by an author whose name contains the string 'Plato'?
SQL: SELECT T1.title FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name LIKE "%Plato%"

Question: Show all client names for clients who have not made orders.
SQL: SELECT name FROM Client EXCEPT SELECT T1.name FROM Client AS T1 JOIN Orders AS T2 ON T1.idClient  =  T2.idClient

Question: Return the largest difference in sale price and purchase price.
SQL: SELECT max(saleprice - purchaseprice) FROM Book

Question: What are the titles of all books written by an author with a name that contains Plato?
SQL: SELECT T1.title FROM Book AS T1 JOIN Author_book AS T2 ON T1.isbn  =  T2.isbn JOIN Author AS T3 ON T2.Author  =  T3.idAuthor WHERE T3.name LIKE "%Plato%"