Académique Documents
Professionnel Documents
Culture Documents
begin
declare d count integer;
select count(*) into d count
from instructor
where instructor.dept_name= dept_name
return d count;
end
Find the error in the the above statement .
a) Return type missing
b) Dept_name is mismatched
c) Reference relation is not mentioned
d) All of the mentioned
Ans: a
2 A stored procedure in SQL is a___________
a) Block of functions
b) Group of Transact-SQL statements compiled into a single execution plan.
c) Group of distinct SQL statements.
d) None of the mentioned
Ans: b
3 Which is a database object that groups logically related PL/SQL types, objects and subprograms?
a. Package
b. Module
c. Body
d. Name
Ans: a
4 To call a subprogram directly, users must have the EXECUTE privilege on that subprogram. By
granting the privilege, you allow a user to –
a. Call the subprogram directly
b. Compile functions and procedures that call the subprogram
c. Both A & B
d. None of the above
Ans: c
5 Which of the following combines the data manipulating power of SQL with the data processing
power of Procedural languages?
a. PQL
b. Advanced SQL
c. PL/SQL
d. SQL
Ans: c
6 Write a dynamic program for insert student details like student id, name, class, age, ph no.
Declare
Declare
begin
end;
is
num numlist;
n number := 0;
begin
num := numlist(a,b,c,d);
for i in 1 .. 4 LOOP
if n<num(i) then
n:=num(i);
end if;
end LOOP;
dbms_output.put_line('Biggest number is '||n);
end;
begin
biggest_Num(7,21,42,32);
end;