Home » RDBMS Server » Server Administration » Oracle script needed immediately
Oracle script needed immediately [message #369888] Thu, 02 November 2000 11:28
Deepak
Messages: 111
Registered: December 1999
Senior Member
On January first of some year, a fungus in a large Petri dish has a radius of 1mm, and every day afterward grows 2mm in radius. Between any two dates in that year, how much does the area of the fungus change?

Write a script named fungus_script_ssss_nnnnnn.sql (where ssss is your CS65 section number and nnnnnn is your student ID).

(1) The script first drops, then creates a stored procedure named fungus_procedure_ssss_nnnnnn (with two input parameters and one output parameter):

l input: date_begin entered as a string in format DD-MMM-YYYY.
l input: date_end in the same format and for the same year as date_begin.
l output: area_change (which is the change in area of the mold, the difference in the two areas of the circular mold on the two dates). The two areas must be found from the table, then the smaller (or same) area for the earlier (or same date) subtracted from the area for the second date.

(2) creates a table named fungus_table_ssss_nnnnnn with columns named
A_Month, A_Day, A_Radius, and An_Area.

(3) enters records into the table by using loops, where
l A_Month is the month of the year, spelled out fully in capital letters, beginning with JANUARY and ending with DECEMBER
l A_Day is the day of the month, beginning with 1 and ending with the last day of the month (28, 29, 30, or 31 depending on the month). Leap years are based on the Gregorian calendar (not Julian). The number of days in February depends on the year YYYY
l A_Radius is the radius of mold growing in a big Petri dish, beginning with radius 1 millimeter on January 1 with radius increasing by 2 millimeters per day. For example, on January 2, the radius is 3 mm; on January 3, the radius is 5 mm, etc.
l An_Area is the area of the mold, pr2 where p = 3.1415926 and r is the radius of the mold on that day.

(4) In your script, following that stored procedure, write an anonymous PL/SQL program that
(a) calls the procedure with actual dates entered as literals
(b) outputs to the screen your name, student ID, CS65 section number, the two input dates, and the area_change of the fungus.

Use many concise comments in your coding. Debug, execute, and print your script. Copy your script CS65_3_ssss_nnnnnn.sql to the folder on Server Zeus named CS65 Project 3 Section sssss. If you must drop a 2nd version of your script, name it CS65_3_ssss_nnnnnnB.sql Please backup your files. Correct file names and comments will be graded, along with your code.

Two-points extra credit: Change the anonymous program to prompt the user to input the two dates interactively from the keyboard at run-time, rather than coding the dates as literals. Help the user to enter the correct date format. Submit only one script.
Previous Topic: Oracle script needed immediately
Next Topic: Does each line only display one column ?
Goto Forum:
  


Current Time: Wed May 01 23:22:30 CDT 2024