Question: In SQL 1 ) List all purchases made by customers. Your query should return the Cus _ Code, Inv _ Number, Inv _ Date, P
In SQL
List all purchases made by customers. Your query should return the CusCode, InvNumber, InvDate, PDescript, LineUnits and LinePrice. Sort by Customer code, invoice number, and product description in that order.
Generate a list of customer purchases, including subtotals for the invoice line numbers. Subtotals are a derived attribute, calculated by multipying LineUnits by LinePrice Columns displayed should be CusCode, InvNumber, PDescription, Units Bought this is an alias Unit Price alias and Subtotal alias It is up to you to determine which columns you will use to create the aliases.
Improve the query in question by displaying CusLName, CusFName instead of CusCode. Use proper, modern JOIN syntax to accomplish this. Add meaningful aliases to all columns.
Write a query to display the Customer's Name same format as above the CusBalance and Total purchases for each customer. Total purchase amount is calculated by summing subtotals from problem In other words: Find how how much the customer spent by summing the subtotals.
Add the number of total purchases how many orders to query In other words, how many orders did the customer place?
Calculate the average purchase amount for each customer to query Your column headers should be Customer Last Name, Customer First Name, Total Purchases, Number of Purchases, and Average Purchase Amount. The average purchase amount is calculated for each customer.
Write a query that provides the total number of invoices, the sales total for all invoices, the smallest purchase amount, largest purchase amount, and average purchase amount. You should use aliases to make your output look reasonable for a business user.
Advertising has requested a list of all customers who have never made a purchase, along with the customer's name and phone number. Provide them with a query with this information. Display the name in the style you believe would be most useful briefly explain your choice in the comments.
Calculate the value of products currently in inventory. The value of the products can be calculated using PQOH quantity on hand and PPrice. Display results with a subtotal for each different product. You should display the PDescript, PQOH, PPrice, and Subtotal for each product. Use aliases to improve the display.
Which Vendor does this company use the most frequently to supply products? Display the Vendor's name with the most products currently in the Product Table as well as the total number of products for that particular vendor. This query should display correctly if there is a tie between two vendors and if the data in the product table changes eg we begin ordering more products from a particular vendor
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
