Can you figure out how to calculate sale tax? I know how to get Subtotal. Create
ID: 3684972 • Letter: C
Question
Can you figure out how to calculate sale tax? I know how to get Subtotal.
Create a query that will show the order id, item id, price, sales tax and subtotal for all items in the order item table. Create column aliases to describe the sales tax and subtotal columns. Only include in your output those items that sold for $20 or more. Order your output by order id. Your output should look like the following: orderid Item ID Price Sales Tax Subtotal 1004 32.50 1020 47.95 1018 47.50 1017 80.00 1019 30.00 1031 25.99 1029 82.50 1037 85.00 1032 100.00 1038 145.00 1049 20.00 1054 57.50 2000 175.50 2002 125.00 2030 35.00 2031 145.00 34.4500 50.8270 50.3500 84.8000 31.8000 27.5494 87.4500 90.1000 106.0000 153.7000 21.2000 60.9500 186.0300 132.5000 37.1000 153.7000 1.9500 2.8500 4.8000 1.8000 1.5594 5.1000 6.0000 1.2000 10.5300 8.7000Explanation / Answer
select OrderID, ItemID , cast (price as char (6)) as [Price] , '$' + cast ((round(price * .06), 2) as char (7)) as [Sales Tax] // columns alias , '$' + cast ((round(price * .06 + price), 2) as char (8)) as [Subtotal] //column alias from ORDER_ITEM where price >= 20 order by OrderID;
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.