Database schema:
CREATE TABLE Warehouses (
  Code NUMBER PRIMARY KEY,
  Location TEXT,
  Capacity NUMBER
);
CREATE TABLE Boxes (
  Code TEXT PRIMARY KEY,
  Contents TEXT,
  Value NUMBER,
  Warehouse NUMBER,
  FOREIGN KEY (Warehouse) REFERENCES Warehouses(Code)
);

Question: What is the total capacity of all warehouses?
SQL: SELECT sum(capacity) FROM warehouses

Question: What is the average value of boxes for each warehouse?
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse

Question: What are the distinct warehouses that have boxes with Rocks or Scissors as contents?
SQL: SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS  =  'Rocks' OR CONTENTS  =  'Scissors'

Question: Find the unique contents of all boxes whose value is higher than the average value of all boxes.
SQL: SELECT DISTINCT CONTENTS FROM boxes WHERE value  >  (SELECT avg(value) FROM boxes)

Question: What is all the information about the warehouses?
SQL: SELECT * FROM warehouses

Question: For each warehouse location, what is the value of the most expensive box?
SQL: SELECT max(T1.value) ,  T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code GROUP BY T2.location

Question: Find the type of contents that are not in the warehouses located at New York.
SQL: SELECT CONTENTS FROM boxes EXCEPT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'

Question: Find the code of boxes that are stored at the warehouses located at Chicago or New York.
SQL: SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' OR T2.location  =  'New York'

Question: What are the codes of all boxes, as well as the locations of the warehouses they are in?
SQL: SELECT T1.code ,  T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.Warehouse  =  T2.Code

Question: What are the different contents of boxes for which the value is higher than the average value across all boxes?
SQL: SELECT DISTINCT CONTENTS FROM boxes WHERE value  >  (SELECT avg(value) FROM boxes)

Question: Select the codes of all the boxes located in Chicago.
SQL: SELECT T1.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago'

Question: Find the average and total capacity of all warehouses.
SQL: SELECT avg(capacity) ,  sum(capacity) FROM warehouses

Question: What are the average values of boxes for each warehouse than has an average value greater than 150?
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse HAVING avg(value)  >  150

Question: Find all different contents stored in New York.
SQL: SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE LOCATION  =  'New York'

Question: Find the total, average, and maximum capacity for different locations.
SQL: SELECT sum(capacity) ,  avg(capacity) ,  max(capacity) ,  LOCATION FROM warehouses GROUP BY LOCATION

Question: Find the warehouses which store contents Rocks or Scissors.
SQL: SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS  =  'Rocks' OR CONTENTS  =  'Scissors'

Question: Find the total value of boxes stored in the warehouse with the largest capacity.
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code ORDER BY T2.capacity DESC LIMIT 1

Question: Find the number of different locations where Rocks are stored.
SQL: SELECT count(DISTINCT LOCATION) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks'

Question: Find the average and total values of all boxes.
SQL: SELECT avg(value) ,  sum(value) FROM boxes

Question: What is the average value of boxes?
SQL: SELECT avg(value) FROM boxes

Question: Find the location of the warehouses which store contents Rocks and Scissors.
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'

Question: What is the code and contents for the box that has the smallest value?
SQL: SELECT code ,  CONTENTS FROM boxes ORDER BY value LIMIT 1

Question: What are the average and total capacities across all warehouses?
SQL: SELECT avg(capacity) ,  sum(capacity) FROM warehouses

Question: What are the average and maximum values for each type of content in boxes?
SQL: SELECT avg(value) ,  max(value) ,  CONTENTS FROM boxes GROUP BY CONTENTS

Question: Find the contents that are stored in both Chicago and New York.
SQL: SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'

Question: Find the location of the warehouses which have contents Rocks but not Scissors.
SQL: SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks' EXCEPT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Scissors'

Question: List all different types of contents ordered by contents.
SQL: SELECT DISTINCT CONTENTS FROM boxes ORDER BY CONTENTS

Question: How many different contents are stored in boxes?
SQL: SELECT count(DISTINCT CONTENTS) FROM boxes

Question: What are the codes and corresponding contents of boxes for which their value is higher than the values of all boxes containing Scissors?
SQL: SELECT code ,  CONTENTS FROM boxes WHERE value  >  (SELECT max(value) FROM boxes WHERE CONTENTS  =  'Scissors')

Question: Select the average value of all the boxes.
SQL: SELECT avg(value) FROM boxes

Question: What are the different contents of boxes, ordered alphabetically?
SQL: SELECT DISTINCT CONTENTS FROM boxes ORDER BY CONTENTS

Question: Select the warehouse code and the average value of the boxes in each warehouse.
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse

Question: Select the warehouse code and the average value of the boxes only for those warehouses where the average value of the boxes is greater than 150.
SQL: SELECT warehouse ,  avg(value) FROM boxes GROUP BY warehouse HAVING avg(value)  >  150

Question: Find the total values of boxes that are not in the warehouses located at Chicago.
SQL: SELECT sum(T1.value) FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location != 'Chicago'

Question: What are the different locations of warehouses?
SQL: SELECT count(DISTINCT LOCATION) FROM warehouses

Question: Select the codes of all warehouses that are above capacity.
SQL: SELECT T2.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse  =  T2.code GROUP BY T2.code HAVING count(*)  >  T2.capacity

Question: Find the total capacity of all warehouse locations.
SQL: SELECT sum(capacity) FROM warehouses

Question: Find all contents present in warehouses located in Chicago and those located in New York.
SQL: SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'New York'

Question: What are the codes of boxes stored in warehouses in Chicago?
SQL: SELECT T1.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T2.location  =  'Chicago'

Question: In how many different warehouses are Rocks stored within boxes?
SQL: SELECT count(DISTINCT LOCATION) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse  =  T2.code WHERE T1.contents  =  'Rocks'

Question: Find the number of distinct types of contents in each warehouse.
SQL: SELECT count(DISTINCT CONTENTS) ,  warehouse FROM boxes GROUP BY warehouse