Explore Westonci.ca, the leading Q&A site where experts provide accurate and helpful answers to all your questions. Join our platform to get reliable answers to your questions from a knowledgeable community of experts. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.
Sagot :
Correct Answer:
c.
SELECT InvoiceNumber, VendorName
FROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorID
WHERE InvoiceTotal IN (SELECT MAX(InvoiceTotal) FROM Invoices)
Explanation:
All options only differ on the WHERE clause:
a: WHERE InvoiceTotal = MAX(InvoiceTotal)
Fails because aggregate functions (like MAX, COUNT, etc) have to be used on the SELECT clause.
b: WHERE InvoiceTotal = (SELECT MAX(InvoiceTotal))
Fails because the SELECT clause is incomplete.
c: WHERE InvoiceTotal IN (SELECT MAX(InvoiceTotal) FROM Invoices)
This one is correct, and returns the InvoiceNumber and VendorName register with the largest value on the InvoiceTotal field.
We appreciate your visit. Hopefully, the answers you found were beneficial. Don't hesitate to come back for more information. Thank you for your visit. We're dedicated to helping you find the information you need, whenever you need it. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.