asked 128k views
3 votes
Show the invoice id, subtotal (price times quantity), tax

(subtotal times 7.5% tax rate), and total (subtotal plus tax) for
all invoices where the subtotal is greater than $150. Set column
aliases ?

asked
User Hala
by
7.4k points

1 Answer

4 votes

Final answer:

To provide invoice details, compute the subtotal by multiplying price by quantity, then calculate tax as 7.5% of the subtotal, and lastly, sum the subtotal and tax to find the total. Include only invoices with subtotals over $150, and set column aliases for clarity.

Step-by-step explanation:

To calculate the invoice details, including subtotal, tax, and total for all invoices where the subtotal is greater than $150, you can use the following steps:

  1. Determine the price of each item and the quantity sold to find the subtotal for each invoice (subtotal = price × quantity).
  2. Calculate the tax for each subtotal by multiplying the subtotal by the tax rate of 7.5% (tax = subtotal × 7.5%).
  3. Add the calculated tax to the subtotal to get the total amount for each invoice (total = subtotal + tax).

Ensure that you only include invoices where the calculated subtotal exceeds $150 in your final calculation. You can set column aliases for readability when presenting your final table, using 'Subtotal' for price times quantity, 'Tax' for the calculated tax, and 'Total' for the sum of subtotal and tax.

For instance, an invoice with 20 items priced at $10 each will have a subtotal of $200. The tax on this invoice would be $200 × 7.5% = $15. The total amount due would therefore be $200 + $15 = $215.

answered
User Tasnim Reza
by
9.2k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.