Calculate the discount price of an item in the table

Assignment Help Computer Engineering
Reference no: EM132213327

Answer the following Questions :

1. Write a script that creates and calls a stored procedure named insert_category. 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. (Two Screenshots - Script and Results) ? Code at least two CALL statements that test this procedure. (Note that this table doesn't allow duplicate category names.)

2. Write a script that creates and calls a stored function named discount_price that calculates the discount price of an item in the Order_Items table (discount amount subtracted from item price). To do that, this function should accept one parameter for the item ID, and it should return the value of the discount price for that item. (Two Screenshots - Script and Results)

3. Write a script that creates and calls a stored function named item_total that calculates the total amount of an item in the Order_Items table (discount price multiplied by quantity). To do that, this function should accept one parameter for the item ID, it should use the discount_price function that you created in exercise 2, and it should return the value of the total for that item. (Two Screenshots - Script and Results)

4. Write a script that creates and calls a stored procedure named insert_products that inserts a row into the Products table. This stored procedure should accept five parameters, one for each of these columns: category_id, product_code, product_name, list_price, and discount_percent. (Two Screenshots - Script and Results) ? This stored procedure should set the description column to an empty string, and it should set the date_added column to the current date. ? If the value for the list_price column is a negative number, the stored procedure should raise an error that indicates that this column doesn't accept negative numbers. Similarly, the procedure should raise an error if the value for the discount_percent column is a negative number. ? Code at least two CALL statements that test this procedure.

5. Write a script that creates and calls a stored procedure named update_product_discount that updates the discount_percent column in the Products table. This procedure should have one parameter for the product ID and another for the discount percent. (Two Screenshots - Script and Results) ? If the value for the discount_percent column is a negative number, the stored procedure should raise an error that the value for this column must be a positive number. ? Code at least two CALL statements that test this procedure.

Reference no: EM132213327

Questions Cloud

Convert an infix expression to a postfix expression : Write semantic actions for the following grammar to convert an infix expression to a postfix expression that is stored in E_post.
Record adjusting entries in separate parts : DH Corporation (DHC) was founded in 2000 by Eric Conner and Phil Martin. The company designs, installs, and services security systems for high-tech companies.
Write a sequence to restore the registers from the stack : Write a sequence to restore the registers from the stack back onto the same registers.
Why is character of gain or loss on a disposition important : Why is the character of a gain or loss on a disposition important? What are the three types of recognized gains or losses that determine their taxation?
Calculate the discount price of an item in the table : Write a script that creates and calls a stored function named discount_price that calculates the discount price of an item.
Write the sequence of instructions you need to write : Write the sequence of instructions you need to write into Python from the moment you open the session to load a picture.
What is qbi deduction amount : Dorothy is an owner-employee in an engineering services firm that is organized as an S corporation. Her share of QBI income is $40,000 and her share.
Calculate the factorial value from 1 to n and outputs : Write a script that takes an input number - N, calculates the factorial value from 1 to N and outputs HTML5 text as shown below:
Calculate the product of the odd integers from 1 to n : Write a script that will calculate the product of the odd integers from 1 to n (or from 1 to n-1 if n is even, where n is some integer > 3).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd