Question: hese are queries that use the full Red Cat Database as shown in Figure 3.1. To do these queries you cannot use the SimplifiedSales database.

hese are queries that use the full Red Cat Database as shown in Figure 3.1. To do these queries you cannot use the SimplifiedSales database. You must use the full Red Cat tables of Customer, Sale, SaleItem, Product, Manufacturer, and Employee tables.

For each information request below, formulate a single SQL query to produce the required information. In each case, you should display only the columns requested. Be sure that your queries do not produce duplicate records unless otherwise directed.

1 For each manufacturer in California, Oregon, or Washington, what is the minimum list price of a product from that manufacturer? Name column MinimumPrice. Only show Manufacturer name and the minimum price.

2) What are the dollar amounts of each Sale (sum the Quantity * SalePrice for each sale) made on Jan 1, 2015 for each customer? Include CustomerID, SaleID, and a newly calucalted column named SumSaleAmt.

3 What is list price of the most expensive and least expensive product in each category? Your result should have three columns: Category, HighPrice, and LowPrice. Sort the results alphabetically Category.

4 Make a list of Sales for February 2014. Include the Sale ID, SaleDate, the total number of items sold (sum of quantity), and the total amount (sum of quantity times sale price) for each sale. Sort the output by SaleID. Name the new fields ItemCount and SaleTotal.

5 What was the sum of all sales made during each month of 2014? A sale amount is defined as (Quantity*SalePrice). Use the Round function to limit output to two decimal places [e.g. round(_____, 2)]. Name the fields Month and TotalSales.

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 General Management Questions!