Here is my query:
select product_name, (sum(item_price - discount_amount) * (quantity)) AS product_total
from products inner join order_items
using(product_id)
group by product_name
My query's output:
Expected Output:
I got almost everything to display but Gibson Les Paul
product_total
is wrong and the last row doesn't show the Null
with its product_total
.