Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use this link to download the database: https://drive.google.com/drive/folders/11FLfdYZUbIDxLuifwLcZfb9sMxGBnPiI Part 1) Scalar UDF Create two Scalar UDFs following the best practices recommend by the textbook

Please use this link to download the database:

https://drive.google.com/drive/folders/11FLfdYZUbIDxLuifwLcZfb9sMxGBnPiI

Part 1) Scalar UDF

Create two Scalar UDFs following the best practices recommend by the textbook author

The TaxRate UDF provides the tax rate based on a ShipCountry and returns a FLOAT value.

If the ShipCountry starts with a letter in the range A-J the tax rate is .04 K-P the tax rate is .03 Q-Z the tax rate is .025

The TaxAmount UDF provides the tax due. It takes two values, a SalesAmount and a TaxRate. The SalesAmount is of the MONEY data type and the TaxRate is of the FLOAT data type. The UDF returns a MONEY value.

Create a query that utilizes the two UDFs to display the total tax on sales by country. I apply the discount when calculating the sales amount. The results should be as shown below

image text in transcribed

216 45 828 31262 20 52 77 07 06 24 54 -9. 8 4091 1907 2 2 39414 13514 7 dean dg ay bra ca de fri fra ge el al me no po po sp sw sw uk it m n p p s s s u u v 012345678901

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

define EFFECTIVE PARTICIPATION

Answered: 1 week ago