Question: Please write SQL queries for the following 1. Write a query to count the number of invoices 2. Write a query to count the number

Please write SQL queries for the following

1. Write a query to count the number of invoices

2. Write a query to count the number of customers with a balance of more than $750

3. Generate a listing of all purchases made by the customers. Sort the results by customer code and invoice number.

4. Write a query to display the customer code, balance, and total purchases for each customer. Total purchase is calculated by summing the line subtotals for each customer. Create a query to produce the total purchase per invoice and sort by Invoice Number. Invoice total is the sum of the product purchases in the LINE that corresponds to the INVOICE.

5. List the balances of customers who have made purchases during the current invoice cycle-i.e. for the customers who appear in the INVOICE table. Sort by Customer Code (CUS_CODE).

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!