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

  What is the primary key for each entity

Are there any multivalued attributes shown? If so, discuss how it/they should be handled in the implementation of the relational database.

  What is the highest normal form r is in

What functional dependencies can you conclude from the data above and what is the highest normal form R is in?

  Develop preliminary database tables for huffman trucking log

Use Microsoft Access to develop preliminary (no keys and no relationships) database tables for Huffman Trucking Driver Log.

  Draw a use case diagram for the carpark system

Draw the class diagram which covers all the situations described in the carpark system, showing inheritance, association (aggregation and composition as necessary) and multiplicity. Include all attributes and operations/methods.

  Explain class diagram

Explain Class diagram. Outline the main steps in developing a class diagram for a Use Case(UC).

  Create the primary key and foreign keys using a uml class

In order to move forward, the local university will need to develop a data model that will retain student records and perform various data extract transform and load (ETL) processes.

  Create a dtd file and an xsd file that specify the schemas

Create an XML file that describes 3 product elements; each product has three sub-elements: id, name, and description.

  Data storage and compression

Data Storage and Compression- Imagine that you are serving in the role of director of data center operations for your company, which is currently using redundant sites as backup and manually managing replication and failovers

  Object approach improve the systems development process

How is the object approach different from the data and process approaches to systems development? And how can the object approach improve the systems development process

  Evolution of utilizing data analytics in business

Define data analytics in general and provide a brief overview of the evolution of utilizing data analytics in business. Analyze the main advantages and disadvantages of using data analytics within the industry or company that you have chosen

  Write expressions in relational algebra to answer queries

Write expressions in relational algebra to answer the queries -  List the names of persons who do not own any car.

  Create an entity-relationship diagram using conceptual data

Create an entity-relationship diagram using the conceptual data model located in the assignment description

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