Question: Write SQL queries for the following: (submit the query and a screenshot of the results) (20 points) write an insert statement that adds this row

Write SQL queries for the following: (submit the query and a screenshot of the results)

(20 points) write an insert statement that adds this row to the invoices table (20 points)

invoice_id: the next id in the sequence (find out which sequence this should be)

vendor_id: 35

invoice_number: AX-014-027

invoice_date: 09-26-2017

invoice_total: $850.58

payment_total:$0.00

credit_total:$0.00

terms_id: 2

invoice_due_date: 10-09-2017

payment_date: null

use select statement to show the new record

(20 points) update that row adding the payment_total of $600 and the rest of the invoice will be in the credit_total and make the payment_date as of todays date.

Use select statement to show the updated record

(30 points) Update the default_terms_id of the vendors table and make it equal to the terms_id of the invoices table, for those vendors who have positive credit total (credit_total>0), yet there were no payments (payment_total=0) on the system.

a. You will hardcode the default_terms_id in the update statement. But you need to write first a select query to show only the records that will be changed.

b. Update records (two update commands)

c. Use a select statement to show the updated records (vendor_name, default_terms_id, terms_id, invoice_number, invoice_total, credit_total, payment_total)

Submit the following:

The select query of question (a.) and its result.

The two update commands.

The result of the select query in (c.) to show that the update was correctly done

(30 points) Classify the vendors who lives in Ohaio based on their zipcode into the following reigon:

VENDOR_ZIP_CODE region

-------------------- ----------------

44074 north

43305 south

43221 east

45225 east

Or south if not in any of the above zip codes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!