SQL Please help me by filling in the 8 ____________ blanks below with the correc
ID: 3591113 • Letter: S
Question
SQL Please help me by filling in the 8 ____________ blanks below with the correct SQL statements. Thank you in advance!!
Fill in the blanks in the SQL statement below that will list invoice_number, vendor name, invoice_total. Use the alias i for invoices and the alias v for vendors.
SELECT invoice_number, name, invoice_total
FROM ___________ , ____________
WHERE _____________ .invoice_id = _____________ .invoice_id ;
Fill in the blanks in the SQL statement below that will create a view named vendor_invoices which lists invoice_number, vendor name, invoice_date and invoice_total for all invoices.
CREATE VIEW ______________ AS
SELECT invoice_number, name, invoice_date, invoice_total
FROM invoices , ________________
WHERE ___________ .invoice_id = _____________ .invoice_id ;
Explanation / Answer
1. SQL statement to list invoice_number, vendor name, invoice_total:
SELECT i.invoice_number, v.name, i.invoice_total
FROM invoices i , vendors v WHERE i.vendor_id = v.vendor_id ;
2. SQL statement that will create a view named
vendor_invoices which lists invoice_number, vendor name, invoice_date and
invoice_total for all invoices.
CREATE VIEW vendor_invoices AS
SELECT i.invoice_number, v.name, i.invoice_date, i.invoice_total
FROM invoices i, vendors v WHERE i.vendor_id = v.vendor_id ;
Note :- The only relation between vendors and invoices table is vendor_id.
There is no relation like , .invoice_id = _____________ .invoice_id
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.