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