Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In SQL, 1. Create a view named OPEN_ITEMS, that shows the invoices that haven't been paid. This view should return four columns from the vendors

In SQL,

1. Create a view named OPEN_ITEMS, that shows the invoices that haven't been paid. This view should return four columns from the vendors and invoices table: vendor_name, invoice_number, invoice_total, and balance_due (invoice_total - payment_total - credit_total).

2. Write a SELECT statement that returns all the columns in the OPEN_ITEMS view that you created in exercise 1, with one row for each invoice that has a balance due of $1000 or more.

3. Create a view named OPEN_ITEMS_SUMMARY that returns ONE summary row for each vendor that has invoices that haven't been paid. Each row should include vendor_name, open_item_count (the number of invoices with a balance due), and open_item_total (the total of the balance due amounts).

4. Write a SELECT statement that returns just the 5 rows from the open_items_summary view that you created in exercise 3.

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

The Database Management Systems

Authors: Patricia Ward, George A Dafoulas

1st Edition

1844804526, 978-1844804528

More Books

Students also viewed these Databases questions

Question

1. Who is responsible for resolving this dilemma?

Answered: 1 week ago

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago