Assignment 4a
Assignment 4a
AVG(Amount) AS Average_Amount
FROM Cust_Order;
-- 2
SELECT
CASE
WHEN 100<200 THEN 'LESS'
WHEN 100=200 THEN 'EQUAL'
ELSE 'MORE'
END
AS Check_the_Number;
-- 4. Using a case statement, find the status of the amount. Set the status of
the amount as high amount, low amount or medium amount based upon the
condition.
SELECT *,
CASE
WHEN Amount< 2000 THEN 'LOW'
WHEN Amount BETWEEN 2000 AND 4000 THEN 'MEDIUM'
ELSE 'HIGH'
END
AS Amt_Comparision
FROM Cust_Order;