Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4 2 8 perspective using the techniques preseful, and less susceptible ys couripts that are more general, more use solve problems that calion, you '

428
perspective using the techniques preseful, and less susceptible ys couripts that are more general, more use solve problems that calion, you ' be solved using any other technique.
In the next chapter, you'll expand on what you've learned here by learning how to code stored procedures, functions, and triggers. These objects are basically one-batch scripts that are stored with the database. But they provide special functionality that gives you greater control over a database, who has access to it, and how they can modify it.
Terms
script
batch
T-SQL statement
variable
scalar variable
scope
local variable
global variable
table variable
temporary table
local temporary table
global temporary table nested statements
WHILE loop
cursor error handling exception handling
snippet
surround-with snippets
system function
dynamic SQL
Exercises
Write a script that uses one variable to store the count of all of the invoices in the Invoices table that have a balance due and another variable to store 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 script should display a result set that displays the values of both variables like this:
Invoice count: 11
Total due: 32020
Otherwise, the script should display a result set that displays a message that says, "Total balance due is less than $30,000."
2. Write a script that declares and sets a variable that's equal to the total outstanding balance due. If the balance due is greater than $10,000.00, the script should return a result set consisting of VendorName, InvoiceNumber, InvoiceDueDate, and Balance for each invoice with a balance due, sorted with the oldest due date first. If the total outstanding balance due is less than $10,000.00, the script should return the message "Balance due is less than $10,000.00."
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago