In SQL What is a query that answers the following question: For those vendors whom we owed
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date: