Question: Code example 6 - 2 WITH Top 5 AS ( SELECT TOP 5 VendorID, AVG ( InvoiceTotal ) AS AvgInvoice FROM Invoices GROUP BY VendorID

Code example 6-2
WITH Top5 AS
(SELECT TOP 5 VendorID, AVG(InvoiceTotal) AS AvgInvoice
FROM Invoices
GROUP BY VendorID
ORDER BY AvgInvoice DESC)
SELECT Invoices.VendorID, MAX(Invoices.InvoiceTotal) AS LargestInvoice
FROM Invoices JOIN Top5
ON Invoices.VendorID = Top5.VendorID
GROUP BY Invoices.VendorID
ORDER BY LargestInvoice DESC;
(Please refer to code example 6-2.) How many rows will there be in the result table when this query is executed?
Group of answer choices
5
6
1
Unknown

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!