Question: In SQL What is a query that answers the following question: For those vendors whom we owed $500 or more in December 2019, how much

In SQL What is a query that answers the following question: For those vendors whom we owed $500 or more in December 2019, how much were we invoiced and by whom? For each vendor from whom we were invoiced $500 or more in December of 2019, display their name, their vendor ID, the number of invoices we received from them in December 2019, and the total amount we were invoiced from them in December 2019. Display the results from greatest amount invoiced to least amount invoiced.

2. What is a query that answers the following question: For those vendors which invoiced us in January 2020, which invoices are being paid from more than 1 account? For each vendor that invoiced us in January 2020, and we paid for the items on those invoices using multiple accounts (i.e., 2 or more different accounts), display their name, their vendor ID, and the number of different accounts we used. Display the results from greatest number of accounts use during January 2020 to least number of accounts used.

3. What is a query that uses an outer join 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. For each of our vendors, 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 outer joins when answering this question • Do NOT employ a union when answering this question

4. What is 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. For each of our vendors, 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.

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 SELECT VendorsName VendorsVendorID COUNTInvoicesInvoiceID AS InvoiceCount SUMInvoicesAmount AS Tot... View full answer

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!