Assignment 6
Objectives
Use a cursor in a stored procedure
Assignment
You will be creating a simple stored procedure that uses one or more Cursors - this will be sp_FullReport. You may develop multiple stored procedures to achieve this that are called from sp_FullReport (hint, hint)
In this stored procedure you create a Cursor that scrolls through each Artist in your Database. For each artist you will produce an output using PRINT that displays an album and then displays the songs, and then displays the musicians for the songs as PRINTED output. Note that you will need to change the output screen to text to allow the print to work (Right Click in Query Window, Results, Results to Text).
You output should look something like this
Artist: Elton John
Album: Goodbye Yellow Brick Road
Song: Funeral For a Friend/Love Lies Bleeding
Dee Murray: Bass Guitar
Elton John: Piano
(shows all musicians in DB for song)
Song: Goodbye Yellow Brick Road
(shows artists like previous)
(shows all songs in Database for Album)
(shows all albums for artist in DB)
Artist: The Who
(repeats report for all artists)
|
You will turn in the text of ONLY the stored procedure sp_FullReport and a screen capture of the execution of this with results.
Information
The video and weekly reading on cursors should be sufficient for this assignment.
Estimated Completion Time
5 hours to cover cursors and write all the necessary stored procedures.
Supporting Lectures
Questions and Answers
External Resources
Grading Criteria
Comments (0)
You don't have permission to comment on this page.