We have to do Case in SQL homework. Never seen it before. The teacher wants returned values.
select orderitems.orderid, orderitems.partid,
case when qty>10 then (orderitems.qty*inventory.price*.9)
when qty>5 then (orderitems.qty*inventory.price*.95)
else (orderitems.qty*inventory.price*1)
end as Extended price
from orderitems, inventory, orders
group by orders.orderid
I get an error for inventory. price, which is a valid table value.
Thanks!