SQL Write a statement which displays the customer\'s last name, customer\'s firs
ID: 3570476 • Letter: S
Question
SQL
Write a statement which displays the customer's last name, customer's first name and the total amount the customer has ever spent. Display the customer's name only once regardless of how many different orders they placed. If a customer has never ordered any books, they d not need to be displayed. Display the results in alphabetical order by the customer's last name followed by the customer's first name. Hint: Be sure to take into account the quantity and actual amount paid for books (as opposed to retail price) when you calculate the total amount that a customer has spent.
Explanation / Answer
select last_name, first_name, SUM( price_paid) from Customer WHERE SUM>0 ;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.