BCS 360 Study Guide - Midterm Guide: Stored Procedure

11 views3 pages
20 Jun 2022
Course
Professor

Document Summary

Assignment three: write a script that creates and calls a stored procedure named spinsertcategory. First, code a statement that creates a procedure that adds a new row to the categories table. To do that, this procedure should have one parameter for the category name. Code at least two exec statements that test this procedure. (note that this table doesn t allow duplicate category names. ) - test fail: (cannot insert duplicate key in object "dbo. categories". Exec spinsertcategory "violins": write a script that creates and calls a function named fnitemtotal that calculates the total amount of an item in the orderitems table (discount price multiplied by quantity). To do that, this function should accept one parameter for the item id, it should use the fndiscountprice function that you created in exercise 2, and it should return the value of the total for that item. Return (select (itemprice - discountamount) as discountprice from orderitems. - check: select itemid, dbo. fndiscountprice(itemid) as discountprice, dbo. fnitemtotal(itemid) as.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related textbook solutions

Related Documents

Related Questions