For each matter the order of the table CUSTOMERS display the name of the customer (companyname), and the following three columns - the minimum, maximum and average
value of orders this customer with the discount (data from tables ORDERS and ORDERDETAILS).
Note: It is assumed that the request will contain only one word SELECT.
The scheme of databases:

select distinct c.companyname,
sum(od.unitprice*od.quantity*(1-od.discount)) over (partition by o.orderid) as "SUM"
from customers c, orders o, orderdetails od where c.customerid=o.customerid
and o.orderid=od.orderid
This query displays the total value of orders. As additionally find the minimum, maximum and average value of orders?
select c.companyname,
min(od.unitprice*od.quantity*(1-od.discount)) over (partition by o.customerid) as "MIN",
max(od.unitprice*od.quantity*(1-od.discount)) over (partition by o.customerid) as "MAX",
avg(od.unitprice*od.quantity*(1-od.discount)) over (partition by o.customerid) as "AVG"
from customers c, orders o, orderdetails od
where c.customerid=o.customerid and o.orderid=od.orderid
This query finds the minimum, maximum and average cost is not the whole order, but only sub-orders (as in one order may be several lots).