Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> HELP! Coding problems!

HELP! Coding problems!

From: Dude <liberal.democrat_at_prodigy.net>
Date: Wed, 05 Dec 2001 04:27:07 GMT
Message-ID: <vmhP7.4449$hu.980479034@newssvr17.news.prodigy.com>


I am having a tough time trying to solve these two programming problems:

1.) I need to write a PL/SQL program that prompts the user for the percent discount that should be applied to the cost of all 'JAVA' courses. Update the COURSE table decreasing the course cost for the 'JAVA' courses by the percent discount. Us an explicit cursor to retrieve all of the updated courses and produce output containing the course id, title, credits, and cost. Use a cursor FOR loop to shortcut the process of displaying the course information. Display the course cost as currency. Don't hardcode literals within the executable section. Create variables and assign initial values in the declarative section.

2.) Write a PL/SQL program to display enrollment for each course section that a specified student is in. Accept a student id from the user. Retrieve all the course sections that the student is enrolled in from the ENROLLMENT table and store them in a PL/SQL table. Using another loop, retrieve a count of all students who are enrolled in each of the sections that are loaded into the table. Produce output like:

Please enter the student id: 123

Course section 95 has an enrollment of 1. Course section 125 has an enrollment of 1.

Explicitly OPEN, FETCH data from, and CLOSE each cursor. Do not use FOR loops to shortcut the process.

I really, REALLY, appreciate any suggestions and help that can be offered. Received on Tue Dec 04 2001 - 22:27:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US