0 votes
in Oracle by
Calculate the percentage of total sales each product contributes to the overall revenue.

1 Answer

0 votes
by

SELECT product_id, SUM(total_amount) / (SELECT SUM(total_amount) FROM sales) * 100 AS percentage_contribution

FROM sales

GROUP BY product_id;

...