Question: SQL ( the tables I ' m working with are in the picture and the database is called StoreDB ) Question 1 : Create a

SQL (the tables I'm working with are in the picture and the database is called StoreDB)
Question 1:
Create a scalar UDF that calculates and returns the average order total for a specific
customer, returning that value as @AverageTotal.
- Note: While the database currently does not have multiple orders for a
customer, write the function assuming for future use where there will be.
Question 2:
Create a procedure that uses the UDF to retrieve the customer IDs and names if the
current average is greater than an input parameter @ThresholdAmount.
- Show how to execute the procedure correctly, using a threshold amount of $90.
Question 3:
Create a stored procedure to retrieve the average order value for orders placed by a
specific customer within a given date range.
- The start and end dates will be the input parameters.
SQL ( the tables I ' m working with are in the

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 Programming Questions!