Please Provide an answer in MYSQL workbench Provide the total dollar amount of i
ID: 3724120 • Letter: P
Question
Please Provide an answer in MYSQL workbench
Provide the total dollar amount of invoices for each customer in the Invoice table that has more than one invoice, return the CustomerId and this totalled amount.
customer table:
Columns:
int(11)
invoice table:
Columns:
int(11)
Explanation / Answer
select CustomerId, sum(Total)
from invoices
group by CustomerId
having count(*) > 1
This query returns customer id and a total bill of customers who have more than 1 invoice.
**Comment for any further queries.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.