So I am trying to...
Write a SELECT statement that returns these column names and data from the Products table:
- A column that’s calculated from the previous two columns
- A column that’s calculated from the previous three columns
Round the discount_amount and discount_price columns to 2 decimal places.
Sort the result set by discount price in descending sequence.
Use the LIMIT clause so the result set contains only the first 5 rows.
SELECT product_name, list_price, discount_percent,
CONCAT(discount_percent / 100 * list_price)
ROUND(list_price - discount_amount, 2)
ROUND() instead of CONCAT.
ROUND(discount_percent / 100 * list_price, 2)
The first argument is the number to round. The second argument is how many decimal places to round to.