2. Write a script that creates and calls a stored procedure named invoice_balance. This stored procedure should use two variables to store (1) the count of all of the invoices in the Invoices table that have a balance due and (2) the sum of the balances due for all of those invoices. If that total balance due is greater than or equal to $30,000, the stored procedure should display a result set that displays the values of both variables. Otherwise, the procedure should display a result set that displays a message like this: Total balance due is less than $30,000.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter3: Creating Tables
Section: Chapter Questions
Problem 7SCG: The SERVICE_REQUEST table uses the CHAR data type for the DESCRIPTION and STATUS fields. Is there an...
icon
Related questions
Question

MYSQL

2. Write a script that creates and calls a stored procedure named
invoice_balance. This stored procedure should use two variables to store (1)
the count of all of the invoices in the Invoices table that have a balance due
and (2) the sum of the balances due for all of those invoices. If that total
balance due is greater than or equal to $30,000, the stored procedure should
display a result set that displays the values of both variables. Otherwise, the
procedure should display a result set that displays a message like this:
Total balance due is less than $30,000.
Transcribed Image Text:2. Write a script that creates and calls a stored procedure named invoice_balance. This stored procedure should use two variables to store (1) the count of all of the invoices in the Invoices table that have a balance due and (2) the sum of the balances due for all of those invoices. If that total balance due is greater than or equal to $30,000, the stored procedure should display a result set that displays the values of both variables. Otherwise, the procedure should display a result set that displays a message like this: Total balance due is less than $30,000.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Database Environment
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning