Database schema:
CREATE TABLE Products (
  product_id NUMBER PRIMARY KEY,
  product_type_code TEXT,
  product_name TEXT,
  product_price NUMBER
);
CREATE TABLE Addresses (
  address_id NUMBER PRIMARY KEY,
  address_details TEXT
);
CREATE TABLE Customers (
  customer_id NUMBER PRIMARY KEY,
  address_id NUMBER,
  payment_method_code TEXT,
  customer_number TEXT,
  customer_name TEXT,
  customer_address TEXT,
  customer_phone TEXT,
  customer_email TEXT
);
CREATE TABLE Customer_Orders (
  order_id NUMBER PRIMARY KEY,
  customer_id NUMBER,
  order_date TIME,
  order_status_code TEXT,
  FOREIGN KEY (customer_id) REFERENCES Customers(customer_id)
);
CREATE TABLE Order_Items (
  order_item_id NUMBER,
  order_id NUMBER,
  product_id NUMBER,
  order_quantity TEXT,
  FOREIGN KEY (product_id) REFERENCES Products(product_id),
  FOREIGN KEY (order_id) REFERENCES Customer_Orders(order_id)
);

Question: What is the name of the most expensive product with type Clothes?
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Clothes" ORDER BY product_price DESC LIMIT 1

Question: What are the names, ids, and number of orders made for each customer?
SQL: SELECT T2.customer_name ,  T1.customer_id ,  count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id

Question: Show all order status and the number of orders in each status.
SQL: SELECT order_status_code ,  count(*) FROM Customer_orders GROUP BY order_status_code

Question: What are the ids, type codes, and names for all products?
SQL: SELECT product_id ,  product_type_code ,  product_name FROM Products

Question: What are the names of Hardware product with prices above the average price of Hardware products.
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" AND product_price  >  (SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Hardware")

Question: How many customers do we have?
SQL: SELECT count(*) FROM Customers

Question: How many orders have each order status code?
SQL: SELECT order_status_code ,  count(*) FROM Customer_orders GROUP BY order_status_code

Question: What is the customer id, name, phone, and email for the customer with most orders?
SQL: SELECT T1.customer_id ,  T2.customer_name ,  T2.customer_phone ,  T2.customer_email FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id ORDER BY count(*) DESC LIMIT 1

Question: What are the product type code with at least two products?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code HAVING count(*)  >=  2

Question: Show all customer names, ids and the number of orders by each customer.
SQL: SELECT T2.customer_name ,  T1.customer_id ,  count(*) FROM Customer_orders AS T1 JOIN Customers AS T2 ON T1.customer_id  =  T2.customer_id GROUP BY T1.customer_id

Question: Show all product ids, product type codes, and product name.
SQL: SELECT product_id ,  product_type_code ,  product_name FROM Products

Question: What is the most frequent product type code?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) DESC LIMIT 1

Question: What are the distinct payment methods used by customers?
SQL: SELECT DISTINCT payment_method_code FROM Customers

Question: Count the number of customers who have not made an order.
SQL: SELECT count(*) FROM Customers WHERE customer_id NOT IN  ( SELECT customer_id FROM Customer_orders)

Question: What are all the address ids and address details?
SQL: SELECT address_id ,  address_details FROM Addresses

Question: List all product names in descending order of price.
SQL: SELECT product_name FROM Products ORDER BY product_price DESC

Question: Show all product type codes and the average price for each type.
SQL: SELECT product_type_code ,  avg(product_price) FROM Products GROUP BY product_type_code

Question: Give the id and name of the cheapest Hardware product.
SQL: SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1

Question: How many customer orders do we have?
SQL: SELECT count(*) FROM Customer_orders

Question: How many customers use each payment method?
SQL: SELECT payment_method_code ,  count(*) FROM Customers GROUP BY payment_method_code

Question: What are the ids and product types for all products, sorted alphabetically by product name?
SQL: SELECT product_id ,  product_type_code FROM Products ORDER BY product_name

Question: What are the ids and names of all customers?
SQL: SELECT customer_id ,  customer_name FROM Customers

Question: Show all the order dates and ids of the orders with quantity of any product larger than 6 or with more than 3 products.
SQL: SELECT T1.order_date ,  T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id WHERE T2.order_quantity  >  6 UNION SELECT T1.order_date ,  T1.order_id FROM Customer_Orders AS T1 JOIN Order_items AS T2 ON T1.order_id  =  T2.order_id GROUP BY T1.order_id HAVING count(*)  >  3;

Question: What is the price for the product with name Monitor?
SQL: SELECT product_price FROM Products WHERE product_name  =  "Monitor"

Question: What is the product id and product name for the cheapest Hardware type product?
SQL: SELECT product_id ,  product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC LIMIT 1

Question: How many customers have ordered the product named Monitor?
SQL: SELECT count(DISTINCT T3.customer_id) FROM Order_items AS T1 JOIN Products AS T2 ON T1.product_id  =  T2.product_id JOIN Customer_orders AS T3 ON T3.order_id  =  T1.order_id WHERE T2.product_name  =  "Monitor"

Question: Show all payment method codes and the number of customers in each code.
SQL: SELECT payment_method_code ,  count(*) FROM Customers GROUP BY payment_method_code

Question: Count the number of products of the type Hardware.
SQL: SELECT count(*) FROM Products WHERE product_type_code  =  "Hardware"

Question: What is the product type with least number of products?
SQL: SELECT product_type_code FROM Products GROUP BY product_type_code ORDER BY count(*) ASC LIMIT 1

Question: What are the names of all Hardware products, sorted by price ascending?
SQL: SELECT product_name FROM Products WHERE product_type_code  =  "Hardware" ORDER BY product_price ASC

Question: What are the names of customers who use the least common payment method?
SQL: SELECT customer_name FROM Customers WHERE payment_method_code  =  ( SELECT payment_method_code FROM Customers GROUP BY payment_method_code ORDER BY count(*) ASC LIMIT 1)

Question: What are the names of the products, sorted by descending price?
SQL: SELECT product_name FROM Products ORDER BY product_price DESC

Question: Return the average price of Clothes.
SQL: SELECT avg(product_price) FROM Products WHERE product_type_code  =  "Clothes"

Question: How many hardware type products do we have?
SQL: SELECT count(*) FROM Products WHERE product_type_code  =  "Hardware"

Question: How many products are there for each product type?
SQL: SELECT product_type_code ,  count(*) FROM Products GROUP BY product_type_code

Question: What is the average price of products for each product type?
SQL: SELECT product_type_code ,  avg(product_price) FROM Products GROUP BY product_type_code

Question: Count the number of customers.
SQL: SELECT count(*) FROM Customers

Question: Give the price of the Monitor product.
SQL: SELECT product_price FROM Products WHERE product_name  =  "Monitor"

Question: Give the order status code that is most frequent across customer orders.
SQL: SELECT order_status_code FROM Customer_orders GROUP BY order_status_code ORDER BY count(*) DESC LIMIT 1