Question: Problem 4 Write a single sql statement that uses a union of multiple queries to answer the following question: For each of our vendors, which

Problem 4
Write a single sql statement that uses a union of multiple queries to answer the following question:
For each of our vendors, which accounts are used to pay them and how often?
For each vendor in our system, identify the account(s) used to pay the vendor as well as the number of
times the account was used to pay the vendor. Display the vendor's name, the vendor's ID, the account
description, and the account usage (i.e., the number of times that account was used to pay that vendor).
If we have not purchased anything from a vendor (i.e., we have not been invoiced by a vendor), display
the phrase 'No Orders Placed With This Vendor' in lieu of an account description. Results should be
displayed from greatest account usage to least accounts usage and column headers should match the
example shown below.
Notes:
Use one or more unions when answering this question
Do NOT employ any outer joins when answering this question
Shown below are the results for Problems 3 and 4
 Problem 4 Write a single sql statement that uses a union

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!