Home » SQL & PL/SQL » SQL & PL/SQL » Oracle and PL/SQL Help
Oracle and PL/SQL Help [message #7855] Sun, 13 July 2003 07:46 Go to next message
Nazma Bepat
Messages: 34
Registered: May 2003
Member
Can someone please help me out. The problem is:

Create a student table, with your last name and first initial as the table name. Include the following:
STUDENT_ID
F_NAME
L_NAME
ADDRESS
ZIPCODE
PHONE

Create a sequence that you will use for your student id; start with 1000 and increment by 1.

Insert five records into your student table. Choose your own values for each record.

I am really new to Oracle PL/SQL and is struggling, not sure where to begin.

Thanks

Nazma
REGISTRATION_DATE
Re: Oracle and PL/SQL Help [message #7857 is a reply to message #7855] Sun, 13 July 2003 08:08 Go to previous messageGo to next message
lajna
Messages: 8
Registered: June 2003
Junior Member
U can create table as
Create table nazma
( STUDENT_ID number(6)
, F_NAME varchar2(20)
, L_NAME varchar2(20)
, ADDRESS varchar2(45)
, ZIPCODE number(7)
, PHONE number(8));
The field length can be altered as per requirement.
Sequence can be created as :-
CREATE SEQUENCE seqno
INCREMENT BY 1
START WITH 1000
;

insert into nazma values(seqno.currval,'mehnaz','ahmed','Dubai',34005,679800);
this will insert one record into the table.
similarly u can do for the next four records

hope this will help u
regards
Lajna
Re: Oracle and PL/SQL Help [message #7877 is a reply to message #7857] Mon, 14 July 2003 19:03 Go to previous message
Nazma Bepat
Messages: 34
Registered: May 2003
Member
Can you help me out with the following:

1. Modify the program from previous to allow the user to continue entering Celsius temperatures until the user enters a sentinel value (you can determine what that sentinel value will be).
2. Create a function to retrieve the values from the user until the sentinel value is entered. The function will return the average of the values entered as an integer.
3. From the main function, call the function you created to retrieve the values and return the average. Then convert that average to Fahrenheit and display the results.
4. Same as before, you can use the following formula to convert from Celsius to Fahrenheit:
a. Fahrenheit = Celsius * (212 – 32) / 100 + 32 (you can abbreviate that if desired)…

Thanks

Nazma
Previous Topic: parallel execution
Next Topic: Number of users
Goto Forum:
  


Current Time: Wed Apr 24 17:51:32 CDT 2024