Question: Please Write SELECT INTO statements to create one test table named Vendor-Invoice that contain the results of a natural join between the Vendors and Invoices

  1. Please Write SELECT INTO statements to create one test table named Vendor-Invoice that contain the results of a natural join between the Vendors and Invoices tables;
  2. Please Write an INSERT statement that adds a row to the Invoices table with the following values: VendorID: 132 InvoiceTotal: $434.58 TermsID: 2 InvoiceNumber: AX-014-027 PaymentTotal: $0.00 InvoiceDueDate: 05/8/2020 InvoiceDate: 4/21/2020 CreditTotal: $0.00 PaymentDate:2021-10-11
  3. Please Write an INSERT statement to insert the first 20 rows of the Vendors table (ordered by DefaultAccountNo) to the VendorCopy table;
  4. Please Write an INSERT statement that adds a row to the InvoiceCopy table for each invoice with a payment date later than 2020-01-01 in the Invoices table;
  5. Please Write an UPDATE statement that modifies the VendorCopy table. Change the Default TermsID to 10 for all the vendors in California (e.g., VendorState = 'CA');
  6. Please Write an UPDATE statement that modifies the InvoiceCopy table. Change the invoice's TermsID to be the corresponding vendor's Default TermsID (hint: DefaultTermsID can be found in the Vendors table). Use a subquery.
  7. Please Solve exercise 6 using a join rather than a subquery.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 SELECT INTO VendorInvoice FROM Vendors NATURAL JOIN Invoices 2 INSE... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!