Answered step by step
Verified Expert Solution
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 '
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 onebatch 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
TSQL 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
surroundwith 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 $ the script should display a result set that displays the values of both variables like this:
Invoice count:
Total due:
Otherwise, the script should display a result set that displays a message that says, "Total balance due is less than $
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 $ 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 $ the script should return the message "Balance due is less than $
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started