Instruction
Excellent! Let's do another exercise.
Exercise
For each country, find the percentage of revenue generated by orders shipped to it in 2018. Show three columns:
ship_country.revenue– the total revenue generated by all orders shipped to that country in 2018.revenue_percentage– the percentage of that year's revenue generated by orders shipped to that country in 2018.
Round the percentage to two decimal places. Order the results in descending order by the revenue column.
Stuck? Here's a hint!
In the inner query, calculate the revenue in 2018. Use the result in the outer query.
Use the following formula to calculate the percentage:
ROUND(SUM(quantity * unit_price) / total_sales.sales_2018 * 100, 2) AS revenue_percentage




