Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago