Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Provide an answer in MYSQL workbench Write a SELECT statement that totals all the invoice amounts by SupportRepId. Return the supportrepid and the total.
Please Provide an answer in MYSQL workbench
Write a SELECT statement that totals all the invoice amounts by SupportRepId. Return the supportrepid and the total. Sort the results so that the support rep id with the largest total of invoices is at the top.
invoice table:
columns:
InvoiceId | int(11) AI PK |
CustomerId | int(11) |
InvoiceDate | datetime |
BillingAddress | varchar(70) |
BillingCity | varchar(40) |
BillingState | varchar(40) |
BillingCountry | varchar(40) |
BillingPostalCode | varchar(10) |
Total | decimal(10,2) |
Customer table:
culomns:
CustomerId | int(11) AI PK |
FirstName | varchar(40) |
LastName | varchar(20) |
Company | varchar(80) |
Address | varchar(70) |
City | varchar(40) |
State | varchar(40) |
Country | varchar(40) |
PostalCode | varchar(10) |
Phone | varchar(24) |
Fax | varchar(24) |
varchar(60) | |
SupportRepId | int(11) |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started