MySQL: Write a query to retrieve the minimum and maximum order amounts among the products.

Minimum and Maximum Order Amounts

Description: Write a query to retrieve the minimum and maximum order amounts among the products.

Table name : orderdetails

use priceEach * quantityOrdered to find the amount.

Sample Output

Hi,

So you can use the following query to get the max and min amount from order_details.

select max(price_each * quantity_ordered) as maxAmount, 
min(price_each * quantity_ordered) as minAmount 
from order_details;

If not Work You Can use this, With Few Changes...

select min(priceEach * quantityOrdered) as minAmount, max(priceEach * quantityOrdered) as maxAmount
from orderdetails;