Display the VendorName, the InvoiceTotal, and the InvoiceLineItemDescription for all invoices that have an InvoiceTotal less than $1,000 and the InvoiceLineItemDescription is the same as the AccountDescription. Display in InvoiceTotal order from smallest to largest. Use the alias LineItems for the InvoiceLineItems table. The correct solution has 42 rows. Show the full query and all the rows.
Since you have not provided the db schema which contains the table description along with column names, I am providing the query by guessing the table/column names. Hence, the query might need some changes in order to run properly. Feel free to reach out in case of any concerns.
QUERY:
SELECT v.VendorName, i.InvoiceTotal, LineItems.AccountDescription FROM Vendor v JOIN Invoice i ON v.VendorID = i.VendorID JOIN InvoiceLineItems LineItems ON i.InvoiceID = LineItems.InvoiceID WHERE i.InvoiceTotal < 1000 ORDER BY i.InvoiceTotal;
Get Answers For Free
Most questions answered within 1 hours.