Ctrl Chapter 4 How to retrieve data from two or more tables 147 4. Write a SELEC
ID: 3869807 • Letter: C
Question
Ctrl Chapter 4 How to retrieve data from two or more tables 147 4. Write a SELECT statement that returns these five columns: vendor_name invoice_ date invoice_number The invoice_number column from the Invoices table li_sequence The vendor_name column from the Vendors table The invoice_date column from the Invoices table The invoice_sequence column from the Invoice_Line_Items table The line_item_ amount column from the Invoice_Line_Items table li_amount Use aliases for the tables. This should return 118 rows. Sort the final result set by vendor_name, invoice_date, invoice_number, and invoice_sequence.Explanation / Answer
SQL:
SELECT V.vendor_name,I.invoice_date,I.invoice_number,
L.invoice_sequence AS li_sequence,L.line_item_amount AS li_amount
FROM Vendors AS V, Invoices AS I, Invoice_Line_Items AS L
ORDER BY vendor_name, invoice_date, invoice_number, li_sequence ;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.