Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started