Answered step by step
Verified Expert Solution
Link Copied!

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)
Email varchar(60)
SupportRepId int(11)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Image Databases Towards Advanced Image Retrieval

Authors: Yihong Gong

1st Edition

1461375037, 978-1461375036

More Books

Students also viewed these Databases questions