Challenge
The full text of this chapter, to read or revisit. To practise, do the exercises.
▶ Do the exercisesExercise 1 — Shop report: Step 1
End of the quarter: the Codémon shop needs its sales report.
Step 1: compute the total revenue of the shop, named revenue. The revenue of a sale is its quantity multiplied by its price. Round the result to 2 decimals with ROUND(..., 2).
Starter code
-- Step 1: total revenueExercise 2 — Shop report: Step 2
Step 2: break the revenue down by category. Return each category and its revenue, highest revenue first. Keep the rounding.
Starter code
-- Step 2: revenue per categoryExercise 3 — Shop report: Step 3
Step 3: find the products that sell everywhere. Return each product_name and the number of distinct regions it was sold in (named regions), keeping only the products sold in more than 2 regions. Sort by product name.
Starter code
-- Step 3: products sold in more than 2 regions