2
Based on the attached table, could you tell me if the resolution of the exercise below is correct?
Show orders that have items that were sold at a discount (discount occurs when the sale price - Ite_precounitario - is lower than the price of "table" - Pro_preco).
My resolution:
select p.ped_numero, ite_precounitario, pro_preco
from pedido p, item i, produto pr
where p.ped_numero = i.ped_numero
and i.pro_codigo = pr.pro_codigo
and ite_precounitario < pro_preco