Sql- cursor chapter 15 | Computer Science homework help
#1. Write a script to declare and use a cursor for the following SELECT statement. Use a WHILE loop to fetch each row in the result set. Omit the INTO clause to fetch directly to the Grids tab.
SELECT VendorName, AVG(InvoiceTotal) AS InvoiceAVG
FROM Vendors JOIN Invoices
ON Vendors.VendorID = Invoices.VendorID
GROUP BY VendorName
#2. Modify the solution to exercise 1 to fetch each row into a set of local variables. Use the PRINT statement to return each row in the format “Name, $0.00” to the Messages tab.
#3. Write a script that uses a cursor and dynamic SQL to output one row from each base user table in the AP database. Specifically exclude the tables named “dtproperties” and sysdiagrams” from the result set.
How it Works
It only takes a couple of minutes to fill in your details, select the type of paper you need (essay, term paper, etc.), give us all necessary information regarding your assignment.
Once we receive your request, one of our customer support representatives will contact you within 24 hours with more specific information about how much it'll cost for this particular project.
After receiving payment confirmation via PayPal or credit card – we begin working on your detailed outline, which is based on the requirements given by yourself upon ordering.
Once approved, your order is complete and will be emailed directly to the email address provided before payment was made!