Challenge

The full text of this chapter, to read or revisit. To practise, do the exercises.

▶ Do the exercises

Exercise 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 revenue

Exercise 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 category

Exercise 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
Back to the course