Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I asked this question earlier, and did not get the right output. I have some cod

ID: 3836162 • Letter: I

Question

I asked this question earlier, and did not get the right output. I have some code but it does not work. I was wondering if anyone can help me with this. Need it in SQL, not ORACLE. Do not worry about question 2

9. Write a function that calculates the total price of the items sold per each invoice/order. Use LINE table to make the calculation [10] LINE INV NUMBER LINE NUMBER PROD CODE LINE UNITS LINE PRICE LINE AMOUNT 39 39 1001 4243213 1001 69.99 1200247 69.99 4243213 1003 39 1003 0637032 1003 69.99 1200247 69.99

Explanation / Answer

Below SQL statement can solve this

Select inv_number,sum(line_amount) AS Total_Price FROM Line GROUP BY inv_number;

here we group the table by invoice number and calculate sum of rows and display them accordingly.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote