Hello, I have a few questions in regards to SQL Server. It was answered on the website before, but whenever I put it in my IDE I get a syntax error, so I will ask here instead for the few I need help with. The topic is MySQL triggers. The third question is as follows: "Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invoice number as a parameter. The INV_SUBTOTAL is the sum of the LINE_TOTAL amounts for the invoice, the INV_TAX is the product of the INV_SUBTOTAL and the tax rate (8 percent), and the INV_TOTAL is the sum of the INV_SUBTOTAL and the INV_TAX."

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello, I have a few questions in regards to SQL Server. It was answered on the website before, but whenever I put it in my IDE I get a syntax error, so I will ask here instead for the few I need help with. The topic is MySQL triggers.

The third question is as follows: 

 

"Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invoice number as a parameter. The INV_SUBTOTAL is the sum of the LINE_TOTAL amounts for the invoice, the INV_TAX is the product of the INV_SUBTOTAL and the tax rate (8 percent), and the INV_TOTAL is the sum of the INV_SUBTOTAL and the INV_TAX."

 

 

Expert Solution
Step 1

Note: The following stored procedure is used to create the stored procedure named prc_inv_amounts. Use proper variables and follow the syntax to avoid syntax errors.

Stored procedures:

  • A procedure is a collection of procedural and Structured Query Language (SQL) statements.
  • A procedure may have input parameter, output parameter and both parameters.
  • It has a declared with a unique named with a unit of procedural code using the proprietary Relational Database Management System (RDBMS) and it is invoked by a host language library routine.

Syntax:

CREATE PROCEDURE procedure_name (parameters1 IN|OUT datatype_1, parameters2 IN|OUT datatype_2, parameters3 IN|OUT datatype_3, ......)

AS

BEGIN

SQL statements

END;

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education