1. Engineering
  2. Computer Science
  3. write a query that returns a row for each customer...

Question: write a query that returns a row for each customer...

Question details

Write a query that returns a row for each customer, a count

    of invoices for each customer, the total extended price of all invoices,

    the min value, and the max value of the invoice total.

    To get the total value of an invoice, you have

    to sum up the extended price value in the InvoiceLines table.

    we use the Invoices, InvoiceLines, and Customers

    tables. The first two tables join on the InvoiceID column. Customers joins

    to Invoices on the CustomerID. Order the results by the

    count of invoices (lDESC), then by the largest invoice (ASC).

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution