Write a script that creates a cursor for a result set

Assignment Help Database Management System
Reference no: EM131049344

Lab Assignment

Exercises

1. Write a script that creates a cursor for a result set that consists of the ProductName and ListPrice columns for each product with a list price that's greater than $700. The rows in this result set should be sorted in descending sequence by list price. Then, the script should print the product name and list price for each product so it looks something like this:

Gibson SG, $2517.00
Gibson Les Paul, $1199.00

2. 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 Results tab.

SELECT LastName, AVG(ShipAmount) AS ShipAmountAvg
FROM Customers JOIN Orders
ON Customers.CustomerID = Orders.CustomerID
GROUP BY LastName;

3. Modify the solution to exercise 2 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.

Reference no: EM131049344

Questions Cloud

What is the net present value of investment opportunity : You work for a small, local telecommunications company. In five years, the company plans to undertake a major upgrade to its servers and other IT infrastructure. Management estimates that it will need up to $450,000 to cover all related costs; Using ..
What is the break-even probability of collection : On each non delinquent sale Cast Iron receives revenues with a present value of $1,240 and incurs costs with a present value of $1,090. Assume there is no possibility of repeat orders and that the probability of successful collection from the custome..
What is the present value of a five year annuity : What is the present value of a five year annuity of $3,000 if the interest rate is 12% and the first payment is made today? $9,655.65 $10,814.33 $12,112.05 $13,200.00
Bonds outstanding that are selling at par value : Jack's Construction Co. has 80,000 bonds outstanding that are selling at par value. Bonds with similar characteristics are yielding 8.6 percent. The company also has 4 million shares of common stock outstanding.
Write a script that creates a cursor for a result set : Write a script that creates a cursor for a result set that consists of the ProductName and ListPrice columns for each product with a list price that's greater than $700.
At what price is the stock selling : Favored stock will pay a dividend this year of $2.88 per share. Its dividend yield is 8%. At what price is the stock selling? (Do not round intermediate calculations.)
Maturity of the bonds-what is the price of the bond now : Several years ago, Castles in the Sand Inc. issued bonds at face value of $1,000 at a yield to maturity of 5.8%. Now, with 5 years left until the maturity of the bonds, the company has run into hard times and the yield to maturity on the bonds has in..
What was plylers equity multiplier : Assuming that all Plyler’s sales are on credit, what was the company’s Days Sales Outstanding in 2015? (For balance sheet accounts, use the average of the beginning and end-of-year balances). What was Plyler’s Equity Multiplier for 2015?
Explain what the wacc means : BUS 420 - Corporate Finance - Explain what the WACC means, how can you use it in decisions, and do you think that you got a reasonable estimate.

Reviews

Write a Review

Database Management System Questions & Answers

  How data collection and data analysis can be overlapping

Summarize the process of coding, classifying, categorizing, and labeling primary patterns as it pertains to qualitative data analysis. Describe how data collection and data analysis can be overlapping activities in qualitative research.

  Explain turing and von neumann models

Write a 2 page research paper (excluding the title page) on the Turing and von Neumann models. Compare and contrast each and discuss which model is better and why.

  Mark the words as index entries behavior and favorable

Mark the following words in the document as index entries: behavior (four instances), favorable (five instances), and impression (eight instances).

  Draw the er diagram for the company database

Using ER Assist Tool to draw the ER Diagram for the Company Database. The Requirements were discussed in the class.

  Database platform selection in certain specific situations

View the Course Project Grading page to view how your project will be graded. Keep in mind that the Writing Quality criterion includes grammar, syntax, spelling, as well as original content.

  Expressions in tuple relational calculus and domain relation

Consider the relational database described in Problem Give expressions in tuple relational calculus and domain relational calculus for each of the following queries: Find all the companies that have offices in all the cities in which company C2..

  Write a join query that for every order

Write a join query that for every order placed on September 5, 1998, (use '05-SEP-1998') will list the order number and order date along with the customer number, last name, and first name of the customer who placed the order.

  Draw the cash-flow diagram for this situation

Construct a loan amortization table, similar to the one shown in table 6-2, showing the principal and interest seperated for the first 6 months of FunSoft's loan.

  Describe discretionary access control

Database security expert to train the database administration team.At the first training session,you ask the trainees to perform the following tasks using Microsoft SQL Server Management Studio. Describe what you expect your trainees to produce.

  What is the purpose of a database driver

what is the purpose of a database driver in terms of what it connects and What are some other examples of Database Drivers out there for the J2EE and .NET Platforms?

  Access values through queries to databases

However, the only way you can access values is through queries to the databases. In single query, you can specify value k to one of two databases.

  Estimate a bernoulli naive bayes classifer

Estimate a Bernoulli Naive Bayes classifer and apply the classifier to the test document - You are asked to perform group average hierarchical clustering on this dataset.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd