Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

1 SELECT INTO VendorInvoice FROM Vendors NATURAL JOIN Invoices 2 INSE... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Modeling and Database Design

Authors: Narayan S. Umanath, Richard W. Scammel

2nd edition

1285085256, 978-1285085258

More Books

Students also viewed these Databases questions