Using the sales and menu tables, calculate how many points each customer earns.
Scoring rules:
- every
€1 spent is worth 10 points
- for products with
product_name = 'sushi', points are doubled
Show the columns customer_id and points, and order by customer_id.
Hints
-
Hint 1
The sales table alone is not enough.
Do a JOIN with menu to get price and product_name.
-
Hint 2
The points change only for sushi.
Think of a CASE WHEN inside SUM(...).