I being asked in exercise to calculate three values from two columns, List_price and discount_amount. partly some of my issue is that my programming instincts want to kick in hindering my ability to fully grasp what is being taught.
Can someone show me what is wrong with the code and provide for a template to better handle the situation.
SELECT list_price, discount_percent, product_name, raw_percent,
discount_amount, (list_price - discount_amount) AS discount_price
FROM (
SELECT discount_percent,
list_price,
(discount_percent /10) = raw_percent
(list_price * raw_percent) = discount_amount
) ORDER BY discount_price DESC LIMIT 5;