Question: Urgent help needed in t-sql programming ! Thanx Question #1 - Create a function that accepts a quantity, unit price and tax rate. The function

Urgent help needed in t-sql programming ! Thanx

Question #1 - Create a function that accepts a quantity, unit price

and tax rate. The function should first calculate the total value of

the information passed in - (quantity * unit price) * 1+taxrate.

If there are more than 100 items purchased, give a discount of 8%. If

more than 250 item were purchased, give a 12% discount

Return the final value. Use the Sales.OrderLines records to test

your function. As outlined earlier in class, name your function with

your first initial and full last name (dbo.rreed_CalculateDiscount)

*/

/*

Question #2- Write a query that exports a JSON string for customerID 200

(Tailspin Toys in Tooele, UT). The query should generate the below string exactly.

Tables that you need to use - Sales.Customers, Sales.CustomerCategories, Application.Citites

Application.StateProvince, and Application.People. I'm using the delivery address

information (including deliveryCityID to join on)

[

{

"CustomerID":200,

"CustomerName":"Tailspin Toys (Tooele, UT)",

"CustomerContact":

{

"PersonID":1399,

"FirstName":"Fanni",

"LastName": "Benko",

"Email":"fanni@tailspintoys.com",

"Address1":"691 Sonkar Avenue",

"Address2":"Suite 264","City":

"Tooele","State":

"Utah",

"Zip":"90100"

},

"CustomerType":"Novelty Shop",

"Website":"http:\/\/www.tailspintoys.com\/Tooele"

}

]

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