9) Auntie B\'s has decided to hold a sale on toddler clothing. Toddler clothing
ID: 3684976 • Letter: 9
Question
9) Auntie B's has decided to hold a sale on toddler clothing. Toddler clothing ranges in sizes 2T - 6T and 6X. Create a query that will determine a 20% discount on the max price for each piece of toddler clothing. Since we do not know which item type id's are for toddler clothing yet, filter your query based on the sizes. Rename your columns as you see below and round the price to two decimals. My output looked like the following: Item ID Price Discount Discounted Price 1000 1001 1002 1021 1048 1050 1058 1060 1068 1069 1070 5.00 1.0000 7.501.5000 10.50 2.1000 3.50 0.7000 4.00 0.8000 8.00 1.6000 2.99 0.5980 1.99 0.3980 5.00 1.0000 7.50 1.5000 10.50 2.1000 4.0000 6.0000 8.4000 2.8000 3.2000 6.4000 2.3900 1.5900 4.0000 6.0000 8.4000Explanation / Answer
Let us consider that Autie B'S clothing database is called as clothing with the following schema
clothing(Itemid, Itemdescription, Size, Price, Stockinhand)
The query for generating the above output is
select Itemid, Price, Price*0.2 as "Discount", round(Price-(Price*0.2)) as "Discounted Price" from clothing where Size LIKE '%T' or Size='6x';
The discounted price will be rounded to 2 integers and the above output can be obtained
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.