Sie sind auf Seite 1von 3

19MCA8217 PUSHKAR KAKKAR

Assignment I

Q1. Write a program that computes the perimeter and the area of a
rectangle. Define your own values for the length and width.
(Assuming that L and W are the length and width of the rectangle,
Perimeter =2*(L+W) and Area = L*W. Display the output on the
screen using dbms_output.put_line.

Ans1. DECLARE LENGTH number:=&LENGTH;

Width number:=&width;

Area number;

Parimeter number;

BEGIN Area:=LENGTH*width;

Parimeter:= 2*(LENGTH+width);

dbms_output.put_line('AREA OF RECTANGLE IS:'||Area);

dbms_output.put_line('PARIMETER OF RECTANGLE IS:'||PARIMETE


R);

END;

/
Q2. Write a program that declares an integer variable called num,
19MCA8217 PUSHKAR KAKKAR

assigns a value to it, and computes and inserts into the temp table
the value of the variable itself, its square, and its cube.

Ans2.CREATE TABLE tempp ( item number, square number, CUBE nu


mber );

TABLE created.

DECLARE num number:=#

BEGIN
INSERT INTO tempp
VALUES(num,
num*num,
num*num*num);

END;

Enter value
FOR num: 5 --PL/SQL procedure successfully completed.

SELECT *
FROM tempp;

--ITEM SQUARE CUBE


--5 25 125

Q3. Convert a temperature in Fahrenheit (F) to its equivalent in Celsius


(C) and vice versa. The required formulae are:-
C= (F-32)*5/9
19MCA8217 PUSHKAR KAKKAR

F= 9/5*C + 32
Display the output on the screen using dbms_output.put_line. Data
has to be input by the user.

Ans 3 . DECLARE F number:=&Fahrenheit;

C number:=&Celsius;

RESULT number;

BEGIN RESULT:=(F-32)*5/9;

dbms_output.put_line('fahrenheit value entered '||F||' equa


l to celsius :'||' '||RESULT);

RESULT:=9/5*C+32;

dbms_output.put_line('fahrenheit value entered '||F||' equa


l to celsius :'||' '||RESULT);

END;

Q5. Discuss in detail various types of maintenance provided to a DB


during its life cycle.
Ans 5. Maintenance involves dealing with changes in the requirements or the implementation
environment, bug fixing or porting of the system to new environments (e.g., migrating a system from a
standalone PC to a UNIX workstation or a networked environment). Since maintenance involves the
analysis of the changes required, design of a solution, implementation and testing of that solution over
the lifetime of a maintained software system, the waterfall life cycle will be repeatedly revisited.

Das könnte Ihnen auch gefallen