Você está na página 1de 14

1.

size of varchar2 in oracle 10g


(ANS:4000character)
2. exception in plsql handled in ____ section
(ANs:Exception)
3.procedure derives the result using ______
OUT parameter
4.mycollection(10)(20) is a multilevel collection -True/False
(ANS:TRUE)
5.collections can be passed in select/view statement-True/False
(ANS:TRUE)
6.which blocks can be used for anonymus pl/sql block(ANS:declare, executable ,exception)
7.if an exception raised doesnt hav a name(ANS: anonymus exception)
8.what is row level/statement level trigger (ANS:trigger type)
10.in a procedure.. reqd statements which doent result in error..
(ANS: end statements)\
End
End procedure name;
11.can a trigger be executed for same table for same statement two times(ex:insert) -true/false
(ANS:TRUE it is called cascading trigger)
12.if('dino'='Dino') wots the result.. wil it evaluate to True/False
(ANS:FALSE)
they are not equal cause in Oracle queries are not case sensitive but data is case sensitive
13.if(a=b) where a=NULL and b=NULL..result wil be NULL-True/False
(ANS:FALSE)
NULL values cannot be compared to anything so conditions evolves to false

1) Exceptions are handled in -------------1.Header


2.Declaration
3.Exception
4.Executable
2) Materialized views (advantages/disadvantages and usage)
Materialized view can store data unlike the simple view.
Materialized view have a property of auto refreshing.
4) what are the things which the functions need to perform
(Ans: must return a value)
6) declare
i number:=250;
j number;
is
if i>100 then
j:=2*i;
elseif i>200 then
j:=3*i;
elseif i>300 then
j:=4*i;
else
j:=5*i;
end if;
what will be the value of j?
(Ans: 500)
7) what are the operations that can be performed in PL/SQL block
1.DDL
2.DML
3.Select
4.all the above
(Ans: All the above)
8) what are the parts of Anonymous blocks
1.header
2.executable
3.declare
4.exception

9) select emp.ename,dept.dname from emp JOIN dept on emp.dno=dept.dno;


1.Natural Join
2.Inner Join
3.Equi Join
4.Outer Join
10) mycollection(10)(20) is this a eg of multi level colletion.(T/F).
(ANS:TRUE)
11) Can a collection be copied to another collection of the same type.(T/F).
(ANS:TRUE(One collection can be assigned to another by an INSERT, UPDATE, FETCH, or SELECT
statement, an assignment statement, or a subprogram call.))
13) Can we create 2 Before insert trigger for the same table.(T/F).
Ans: TRUE we can cascade triggersI have checked using oracle
14) Create or replace trigger <name> before LOGON.......etc.what type of trigger is this.
(ANS:Invalid trigger) (Before LOGON Trigger does not exist)
15) How to declare a user-defined exception
(ANS: <name> exception;) myexp EXCEPTION;
16) When a exception has a name and a number associated to it.
But does not have name to mention in the Raise or When clause then it is what type of exception.
(ANS:Anonymous exception)
21) If a row in Master table is deleted, then it's corresponding rows in child table should be deleted
1) Delete
2) Drop
3) Cascade Delete
22) why the database is called Relational database
1) tables are independent
2) table related to each other
3) consists of tables, queries , reports, forms.
4) (not sure of the option)

23) property of data which, when satisfied, requires every value of one attribute (column)
of a relation (table) to exist as a value of another attribute in a different (or the same)
relation (table)
(Ans: referential Integrity)

24)Which of the following provide only database related error information


a)raise_application_error
b)pragma exceptio_init
c)sqlerrm
d)sqlcode
25)Which of the following is a madatory part in a sub program
a)header
b)declaration
c)execution
d)exception
(Ans:execution)
26)if('dino'='Dino') this condition wil evaluate to.. True/False
(Ans: False)
27)collections can be passed in select/view statement-True/False
(Ans: True)

if 'Dinu'='dinu' then
&
endif;
a. true
b. false
(ANS:false)
4. customer table(columns) is a parent table and order table(columns) is a
child table----(ANS;for this answer is cascade delete)
7. where do we create function program in plsql block?
(ANS:answer is execution)
8. a number:=null
b number:=null
if a=b then
&
endif;
state whether if statement is true or false :
(ANS:FALSE)
9. create userdefined exception with the name myexp:
(ANS:answer is myexp exception)
11. can we have multiple triggers in the same table? state true/false
(ANS:TRUE)
13. dow do we delete trigger from the table?
(ANS:drop trigger triggername)
14. exception handling is done in:
exception
15. what datatype is used if the value of the variable is -524? (choose
three)
number
positive
integer
number(6,2)
(ANS:number,integer)
16. when trigger is fired?
Before log on or log off happens and
when a create or alter table is fired. Or
when data base starts up or shuts down

17. create trigger


trigger fired on:
1. before updation on some column
2. ............
you suppose to create trigger based on the aboue 2options....check the
syntax of the block it must contain before update...for each row
18. can we copy elements in one collection to another collection state true
or false:
(ANS:true)
19. declare
a varchar2(5);
begin
<inner>
begin
a ='justice';
when value_error then
raise num_not_found exception
when not_found then
dbms.......("inner block")
end
exception
when not_found then
dbms......("outer block");
a. no exceptions
b. inner block
c. outer block
d. num_not_found exception
20. one query from collections: how can we insert value into the aboue
collection...i dont remember the block....
answer might be name.extend; name(1):='satish';
21. another procedure block.....
create procedure procedure_name(id number in, city varchar2 in, name
varchar2 in)
begin
insert into procedure_name(vid,vcity,vname) values(id,city,name)
end;
a. execute insert into procedure_name(123,'chennai','sunny')
c. execute insert into procedure_name(id=123,city=>chennai,
name=>sunny)
b. execute insert into
procedure_name(id:=123,city:='chennai',name:'sunny')
22. function related block...dont remember......to retrieve the value....when
compiled, error is generated...??
the block is like this (think so)
declare
.....
begin
......

function_name(100)
.....
...
..
end
a. exception is not declared properly
b. cannot use function statement directly into the plsql block and
database
c. exception name is not declared
23. create procedure pro
a number
begin
a:=0.00
end pro
create procedure body pro
begin
dbms.....("discounted"||nuvl(a,1)
end pro
begin
a:=0.10
end
what is the value of a?
a. a=1
b. a=0.10
c. a value is 0.00 throughout the session
d. a value is 0.10 when package is invoked 1st time in session.
(plz conform the ans....)
24. varchar2
a. only characters
b. characters and numericals
c. only numbericals
26. find out word contaning pattern ill as last letters...the word has 4
letters for eg bill....
a. select.....where name='%ill%'
b. select.....where name like '_ill'
c. select.....where name='_%ill'
d................................

27. which function is used to undone changes for transaction


a. rollback complete
b. rollback to savepoint
c. commit changes
d. rollback
(ANS:rollback)

1. which part is not included for anonymous block in plsql?


a.
b.
c.
d.

declarative
header
exception
executive

(ANS:header)
2. create trigger triggername
before logon
.
.
.
this trigger is of which type?
a. invalid trigger(answer)
3. an exception has error number and description but dont have name to raise
or while using when in plsql block
which type of exception is this
a,
b.
c.
d.
(ANS:B)

named
anonymous
unhandled
handled

Hello friend this will help u


q.1
11.
For I in 1..10
If i=4 or i=6
then null
else insert values(i)
end if
commit
end loop
rollback
end
How many values are inserted at hee end
0,1,8,10
Ans is 8

q12
size of varchar2 in oracle 10g
ans 4000 bytes

q3
When a exception has a name and a number associated to it.
But does not have name to mention in the Raise or When clause then it is what type of exception.
ans
anonymus exception
q4
a number:=null;
b numbver:=null
if(a=b)
endif
-True/False
check the answer
might be false
false maine tuze explanation diya hai iska

q5 Can a collection be copied to another collection of the same type.(T/F).


true
q6 Create or replace trigger <name> before LOGON.......etc.what type of trigger is this.
Ans:invalid trigger
no before logon like this

q7 .in a procedure.. reqd statements which doent result in error.. end statements
this ques is like checkbox select two
Answer
1 end procedure_name;
2 end;

q8 In plsql block in which section we create functional program


1 header
2 declare
3 executable
4 exception
ans :might be header
this ques is repeated for me

q9
In which of the following clauses can subquery be used?
a. into-----insert
b. from-----select
c. group by--d. order by--ans: a,b
q10: if the date is march 21, 2001;
write query for the format "21st of march 2011 14:00:00 am"
answer is: select to_char(to_date(21-march-2011,dd-mm-yyyy),'fmddspth "of" month yyyy
fmhh:mm:ss am') from dual;
plz check the answer not sure
q11
dow do we delete trigger from the table?
ans
drop trigger triggername
q12
what datatype is used if the value of the variable is -524? (choose three)
number
positive
integer
number(6,2)
answer
number
integer
q13. create trigger
trigger fired on:
1. before updation on some column
2. ............
Ans
you suppose to create trigger based on the aboue 2options....check the syntax of the block it
must contain before update...for each row

q14 declare
a varchar2(5);
begin
<inner>
begin

a ='justice';
when value_error then
raise num_not_found exception
when not_found then
dbms.......("inner block")
end
exception
when not_found then
dbms......("outer block");
a. no exceptions
b. inner block
c. outer block
d. num_not_found exception

q15.
create procedure procedure_name(id number in, city varchar2 in, name varchar2 in)
begin
insert into procedure_name(vid,vcity,vname) values(id,city,name)
end;
a. execute insert into procedure_name(123,'chennai','sunny')
c. execute insert into procedure_name(id=123,city=>chennai, name=>sunny)
b. execute insert into procedure_name(id:=123,city:='chennai',name:'sunny')
ans a
q16 function related block...dont remember......to retrieve the value....when compiled, error is
generated...??
the block is like this (think so)
declare
.....
begin
......
function_name(100)
.....
...
..
end

a. exception is not declared properly


b. cannot use function statement directly into the plsql block and database
c. exception name is not declared
ans a ye bhi wahan hi dekhana padega
q17 varchar2
a. only characters
b. characters and numericals

c. only numbericals
ans character and numericals

q18 which function is used to undone changes for transaction


a. rollback complete
b. rollback to savepoint
c. commit changes
d. rollback
check box
rollback to savepoint
rollback
q19 which trigger is related with application ......................
ans application trigger

q20 3. Question on : definition was given and the options were a. query flashback,b. rollback segment,
c. cursor mgmt. I marked the answer as query falashbak . go through its definition
ans query flashback
q21 question package specification and body which is
ans package specification is invoked first time in one session
q22
CREATE OR REPLACE PACKAGE discounts
IS
g_id NUMBER := 7829;
discount_rate NUMBER := 0.00;
PROCEDURE display_price (p_price NUMBER);
END discounts;
/
CREATE OR REPLACE PACKAGE BODY discounts
IS
PROCEDURE display_price (p_price NUMBER)
IS
BEGIN
DBMS_OUTPUT.PUT_LINE(Discounted ||
TO_CHAR(p_price*NVL(discount_rate, 1)));
END display_price;
BEGIN
discount_rate := 0.10;
END discounts;
/
Which statement is true?

A. The value of DISCOUNT_RATE always remains 0.00 in a session.


B. The value of DISCOUNT_RATE is set to 0.10 each time the package is invoked in a session.
C. The value of DISCOUNT_RATE is set to 1.00 each time the procedure DISPLAY_PRICE is
invoked.
D. The value of DISCOUNT_RATE is set to 0.10 when the package is invoked for the first time in a
session.
Answer: D

this ques is not same as in paper but answer is same for it u will get another ques their but answer is
samelike here

q23 You need to remove the database trigger BUSINESS_HOUR.


Which command do you use to remove the trigger in the SQL *Plus environment?
A. DROP TRIGGER business_hour;
B. DELETE TRIGGER business_hour;
C. REMOVE TRIGGER business_hour;
D. ALTER TRIGGER business_hour REMOVE;
E. DELETE FROM USER_TRIGGERS
WHERE TRIGGER_NAME = BUSINESS_HOUR;
ans a
q24
SELECT empid as "empno", sum(salary)
FROM emp
WHERE some condition
group by empno
ORDER BY 2;
in which clause you will get error
1 where
2 group by
3 order by
4 from clause

One question was on how to declare number in procedure answer was as below:
n1 number :=10;
n2 number;
One question on finding area in which width is not declared for that..
Ans: v_width variable is not declared
One question on varray:
Ans: the one which contains 1,1,1

Você também pode gostar