←TrainerTask 30 / 217

Ticket #30

Discount rules

Task

Marketing has two discount rules: the discount is 20%, but the final price never drops below $200, and the discount itself never exceeds $200 in money.

Output name, price, sale_price (the discounted price respecting the lower limit) and discount (the size of the discount respecting the ceiling). Both numbers with two decimal places. Row order does not matter.

Hint: GREATEST takes the larger of two values, LEAST the smaller. You do not need CASE here.

SQL query

Query results will appear here

Preparing the lesson database…