Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SELECT i.vendor_id, MAX(i.invoice_total) AS largest_invoice FROM invoices i JOIN

ID: 3656789 • Letter: S

Question

SELECT i.vendor_id, MAX(i.invoice_total) AS largest_invoice FROM invoices i JOIN (SELECT vendor_id, AVG(invoice_total) AS average_invoice FROM invoices GROUP BY vendor_id HAVING AVG(invoice_total) > 100 ORDER BY average_invoice DESC) ia ON i.vendor_id = ia.vendor_id GROUP BY i.vendor_id ORDER BY largest_invoice DESC (Please refer to code example above.) When this query is executed, each row in the result table will show Answer a. the average invoice total related to that row b. the largest invoice total related to that row, but only if it

Explanation / Answer

c. the largest invoice total related to that row