Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please download the AdventureWorks2012.bak from the following link: https://drive.google.com/drive/folders/1gfdFkHtUp-VVkhItKiVwkH9G70qP2hzA **Note: to restore the database do the following steps. In Program Files create a folder and

Please download the AdventureWorks2012.bak from the following link:

https://drive.google.com/drive/folders/1gfdFkHtUp-VVkhItKiVwkH9G70qP2hzA

**Note: to restore the database do the following steps. In Program Files create a folder and copy the AdventureWorks2012.bak in there. After creating the empty database, right click the database, point to Task, restore and click database. Under General choose Device,click add, browse to AdventureWorks2012.bak folder and add it. Click on Files and check Relocate all files to folder. Click Options (on the left) and selected Overwrite the existing database (WITH REPLACE).**

Question: 1. Create an empty database called AdventureWorks2012

2. Use the supplied .bak file named AdventureWorks2012.bak to restore the database.

3. Do not incorporate any USE statements in your solution

4. Include a DROP FUNCITON IF EXISTS statement for the UDF before the CREATE FUNCTION statement. Dont forget the GO statement.

5. Create a UDF called DBO.InventoryLevel

a. The UDF requires an integer as a product identifier as the first parameter

b. The UDF takes an optional integer as location specifier as the second parameter

c. The UDF returns the quantity of the specified product for the given location

d. If a null location specifier is provided, then return the quantity of the specified product for all locations

6. Ensure that changes to the underlying table(s) will not affect the UDF

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions