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
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