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

  Write queries using the sql group statement

Display total number of employees for each salary within each job title. Columns should include Job Title, Salary, and 'Total Employees'.

  Compare two non-sequential file structure models

Compare the two non-sequential file structure models. What advantages does the first one have over the second and what advantages does the second have over the first?

  How many records would you add or modify in the tables

Suppose you want to generate a report listing each customer name and the amount due from each customer. Which tables contain the data you need to generate the report?

  Delete a contact by having the user enter the name

Delete a contact by having the user enter the name

  Construct a diagram using rationale to map the arguments

Construct a diagram using Rationale to map the arguments about a moral claim that you have identified in the article/case study: Include all supporting and objecting claims.

  Identify any referential integrity violations, if any

Given the following data types of some table fields and the simple schema of the relational database they are a part of, inspect its relationships for any referential integrity violations

  Create a client/property database using microsoft access.

The file New Database window opens, then type the word Client as the name for this file where the cursor is blinking, then click the create bottom.

  What business assumptions were made to define this table

Use the Access Help system to learn how to resize datasheet columns to fit the data, and then resize all columns in the datasheet for the Payment table.

  Roles and responsibilities of database administrator

For this assignment, research different roles and responsibilities of a database administrator. Research 3 routine tasks involved in database administration

  Explain what they will change in dbms technology

Explain how they work and what advantages and disadvantages they bring.

  Delete an existing product from the database

Utilise an include statement to refer to connection.php instead of the long version of the database connection code so that you can keep the database more secure. See Notes for more details.

  Produce different final database state than using trigger

Assume that relation Employee has no tuples in it initially. You are to show the simplest example you can think of where using trigger T1 will produce a different final database state than using trigger T2.

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