***Having some issues with this one*** Also, regarding the first SELECT statemen
ID: 3564361 • Letter: #
Question
***Having some issues with this one***
Also, regarding the first SELECT statement, it should be noted that the emailaddress comes from the Customers table, the other from OrderItems table, with the OrderTotal I am assuming to be the ItemPrice multiplied by the Quantity.
Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns. In addition, you must calculate the order total from the columns in the OrderItems table. Write a second SELECT statement that uses the first SELECT statement in its FROM clause. The main query should return two columns: the customer`s email address and the largest order for that customer. To do this, you can group the result set by the EmailAddress column.
Explanation / Answer
SELECT C1.EmailAddress, O1.OrderID,
(O1.ItemPrice*O1.Quatity) AS
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.