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

SQL Query I have a working JavaFX program that acts as an SQL Client that opens

ID: 3671553 • Letter: S

Question

SQL Query

I have a working JavaFX program that acts as an SQL Client that opens MS Access databases and can run queries and output to tableview. I need to add some functionality and I need help a SQL query. I don't need a full program, just the relevant lines. I have a link to the Access DB file here http://onlyabout.me/Northwind.mdb

If you just want to see the table here is a screenshot: OrderDetails: http://prntscr.com/a7n18n

SQL Query:

Print order total (not including the freight cost) for a given order number

The program will ask the user for an order number, and then print out the total for all products in the order, taking into account quantities and discounts. (All computations should be done within the SQL query). ...

So I think you would take the info from the "Order Details", find each line with that ordernumber and return the result of Unit Price * Quantity - (Unit Price * Discount). I just need help with the code to calculate that and return the data as rows and coulums.

Explanation / Answer

select orderid , sum(UnitPrice * Quantity - UnitPrice * Discount) as order_total from OrderDetails group by orderid having orderid = 10248;