Question: Lab 5-1 /* Create a function in your own database that takes two parameters: 1) A year parameter 2) A month parameter The function then

 Lab 5-1 /* Create a function in your own database that

Lab 5-1 /* Create a function in your own database that takes two parameters: 1) A year parameter 2) A month parameter The function then calculates and returns the total sale for the requested year and month. If there was no sale for the requested period, returns 9. Hints: a) Use the TotalDue column of the Sales.SalesOrderHeader table in an Adventureworks database for calculating the total sale. b) The year and month parameters should use the INT data type. c) Make sure the function returns a if there was no sale in the database for the requested period. */ Lab 5-2 Create a table in your own database using the following statement. CREATE TABLE DateRange (DateID INT IDENTITY, DateValue DATE, Month INT, DayOfNeek INT); Write a stored procedure that accepts two parameters: 1) A starting date 2) The number of the consecutive dates beginning with the starting date The stored procedure then populates all columns of the DateRange table according to the two provided parameters

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