Question: Select the MyGuitarShop DB in the Object Explorer Open the query text window via the New Query Tool. New QueryAdd / * * / Comments

Select the MyGuitarShop DB in the Object Explorer Open the query text window via the New Query Tool.
New QueryAdd /**/ Comments to your script to include your Name, class, and Assignment Name.
Create the following SQL queries using Select in the query window. Comment each step in the script.
Using the Orders Table, do the following:
Display the count of orders and show as Order Count
Display the total tax amount and show as Tax Amount
The result is only 1 row
Create a list of products and their current count on hand and most expensive item
Use the Categories Table
Join this table to the Products table by CategoryID
Display the following:
CategoryName,
Count * as Product Count.
Max ListPrice as MostExpensiveProduct.
Group by CategoryName
Sort by descending Product Count
Create a list of purchases by email address, starting with the largest (in total sales) purchaser's email
Use the Customer Table
This query will need to join the Customer table to the Orders Table by CustomerID
This query will need to join the Orders table to the OrderItems Table by OrderID
Display this content:
Display the Email address,Sum of ItemPrice * Quantity as 'ItemPriceTotal'Calculate the DiscountAmount * Quantity as "Discount Amount Total"
Group this output by EmailAddressSort the data using the ItemPriceTotal in descending order.
Run your created script.

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!