Question: Code example 6 - 1 SELECT VendorName, COUNT ( * ) AS NumberOfInvoices, MAX ( InvoiceTotal - PaymentTotal - CreditTotal ) AS BalanceDue FROM Vendors

Code example 6-1
SELECT VendorName, COUNT(*) AS NumberOfInvoices,
MAX(InvoiceTotal - PaymentTotal - CreditTotal) AS BalanceDue
FROM Vendors JOIN Invoices ON Vendors.VendorID = Invoices.VendorID
WHERE InvoiceTotal - PaymentTotal - CreditTotal >
(SELECT AVG(InvoiceTotal - PaymentTotal - CreditTotal)
FROM Invoices)
GROUP BY VendorName
ORDER BY BalanceDue DESC;
(Please refer to code example 6-1.) When this query is executed, the NumberOfInvoices column for each row will show the number
Question 29 options:
1
of invoices in the Invoices table
of invoices for each vendor
of invoices for each vendor that have a larger balance due than the average balance due for all invoices

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 Databases Questions!