Question: NOTE: Written in SQL Express. Using MyGuitarShop database. Orders Table: PK. OrderId, FK CustomerID OrderItems Table: PK. ItemID, FK OrderID, FK ProductID, Columns: ItemPrice, DiscountAmount,

NOTE: Written in SQL Express. Using "MyGuitarShop database".

Orders Table:

PK. OrderId, FK CustomerID

OrderItems Table:

PK. ItemID, FK OrderID, FK ProductID, Columns: ItemPrice, DiscountAmount, Quantity.

1. Write a script that uses three variables to store (1) the count of distinct orders made in the Orders table (2) the total amount of sales (sales means the price of the item with discount multiplied by the quantity) made in the OrderItems table and (3) the average sales calculated using the first two variables ($843.3). Dont include TaxAmount or shipping costs.

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!