Question: Code example 7 - 1 SELECT vendor _ name, COUNT ( * ) AS number _ of _ invoices, MAX ( invoice _ total -

Code example 7-1
SELECT vendor_name, COUNT(*) AS number_of_invoices,
MAX(invoice_total - payment_total - credit_total) AS balance_due
FROM vendors v
JOIN invoices i
ON v.vendor_id = i.vendor_id
WHERE invoice_total - payment_total - credit_total >
(SELECT AVG(invoice_total - payment_total - credit_total)
FROM invoices)
GROUP BY vendor_name
ORDER BY balance_due DESC
(Refer to code example 7-1.) When this query is executed, the rows will be sorted by...
Group of answer choices
invoice_id
vendor_id
balance_due in descending sequence
vendor_id and then by balance_due in descending sequence

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!