Dear Readers, Welcome to PL/SQL Objective Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of PL/SQL MCQs. These objective type PL/SQL questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular question during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
A. Implicit cursors are used for SQL statements that are not named.
B. Developers should use implicit cursors with great care.
C. Implicit cursors are used in cursor for loops to handle data processing.
D. Implicit cursors are no longer a feature in Oracle.
Ans: A
A. Record type declaration.
B. Opening and parsing of SQL statements.
C. Fetches records from cursor.
D. Requires exit condition to be defined.
Ans:B
A. Use employee.lname%type.
B. Use employee.lname%rowtype.
C. Look up datatype for EMPLOYEE column on LASTNAME table and use that.
D. Declare it to be type LONG.
Ans: A
A. %found
B. %too_many_rows
C. %notfound
D. %rowcount
E. %rowtype
Ans:C
A. LOOP
B. END LOOP
C. IF-THEN
D. EXIT
Ans:B
A. cursor action_cursor is
B. select name, rate, action
C. into action_record
D. from action_table;
E. There are no errors in this statement.
Ans:C
A. open
B. fetch
C. parse
D. None, cursor for loops handle cursor opening implicitly.
Ans:D
A. It causes the cursor to close
B. It causes the cursor to open
C. It loads the current row values into variables
D. It creates the variables to hold the current row values
Ans: B
A. Only one
B. All that apply
C. All referenced
D. None
Ans: A
A. Statement and Row
B. Statement only
C. Row only
D. Oracle Forms trigger
Ans: D
A. customer_12
B. loop
C. customer@orgA
D. 12customer
Ans: A
/* Start main block */
DECLARE
customer_id NUMBER(9) := 678;
credit_limit NUMBER(10,2) := 10000;
BEGIN
/* Start nested block */
DECLARE
customer_id VARCHAR2(9) := 'AP56';
current_balance NUMBER(10,2) := 467.87;
BEGIN
-- what is the value of customer_id at this point?
NULL;
END;
END;
Please select the best answer.
A. 678
B. 10000
C. 'AP56'
D. 467.87
Ans: B.
A. Referring to a column in the database
B. Using a reserved word to declare an identifier
C. Using a hyphen to concatenate two columns
D. Referring to a number variable by using a logical operator
Ans: B.
A. None
B. All exceptions that are referenced in the block
C. One
D. All exceptions that apply
Ans: C.
A. SUM
B. MIN
C. MAX
D. AVG
The correct answers are B and C.
A. foo_number varchar2(10);
B. foo_text number(10);
C. foo_char char(1) := 'Y';
D. foo_time date;
E. foo_text varchar2(10) := 'hello world';
Ans: E
A. CHAR
B. VARCHAR1
C. VARCHAR2
D. INTEGER
E. NUMBER
ANS: B
A. INITIALIZE, GET, CLOSE
B. CURSOR, GET, FETCH, CLOSE
C. OPEN, FETCH, CLOSE
D. CURSOR, FETCH, CLOSE
E. GET, SEEK, HIDE
ANS: C
A. foo_number varchar2(10);
B. foo_text number(10);
C. foo_char char(1) := 'Y';
D. foo_time date;
E. foo_text varchar2(10) := 'hello world';
Ans: E
A. CHAR
B. VARCHAR1
C. VARCHAR2
D. INTEGER
E. NUMBER
ANS: B
A. INITIALIZE, GET, CLOSE
B. CURSOR, GET, FETCH, CLOSE
C. OPEN, FETCH, CLOSE
D. CURSOR, FETCH, CLOSE
E. GET, SEEK, HIDE
ANS: C
A. In the PL/SQL working storage section
B. In the PL/SQL declaration section
C. In the PL/SQL body section
D. In the PL/SQL exception section
E. None of the above
ANS: B
A. 09/09/2009 09:09:09
B. 09/09/2009 09:09:09AM
C. 09/09/2009
D. 09/09/2009 00:00:00
E. None of the above
ANS: D
A. Incantination
B. Integration
C. Continuation
D. Concatenation
E. None of the above
ANS: D
A. DECODE
B. TRUNCATE
C. TO_CHAR
D. NVL
E. Trick question, all of these are Oracle DML functio
ANS: B
A. WHILE LOOP
...
END LOOP;
B. FOR rec IN some_cursor LOOP
...
END LOOP;
C. LOOP
...
UNTIL ;
END LOOP;
D. LOOP
...
EXIT WHEN ;
END LOOP;
E. None of the above. All are valid.
ANS: C.D
A. %NOTFOUND
B. %FOUND
C. %ROWCOUNT
D. %ISOPEN
E. None of the above. All of these are valid.
ANS: E
A. COUNT
B. SUM
C. DISTINCT
D. MIN
E. All of the above.
ANS: C
A. NO_DATA_FOUND ORA-01403
B. TWO_MANY_ROWS ORA-01422
C. DUP_VAL_ON_INDEX ORA-00001
D. OTHERS
E. None of the above. These are all valid.
ANS: B
A. SHOW MISTAKES;
B. DISPLAY MISTAKES;
C. DISPLAY ERRORS;
D. SHOW ERRORS;
E. None of the above.
ANS: D
A. Box, wrapping and binding
B. Header and body
C. Specification and content
D. Specification and body
E. None of the above
ANS: D
a. True
b.False
ANS: A
a.True
b.False
ANS: A
a. True
b. False
ANS: B
a. True
b. False
ANS: A
a.The name of a variable.
b.A literal value.
c.An expression.
d.All of the above.
e.None of the above
ANS: D
a.OUT
b.IN
c.COPY
d.DEFAULT
e.R(ead)
ANS: B
a.OUT
b.IN
c.CONSTANT
d.R(ead)
e.W(rite)
ANS: A
a.IN, OUT, IN OUT
b.R(ead), W(rite), A(ppend)
c.CONSTANT, VARIABLE, DEFAULT
d.COPY, NOCOPY, REF
ANS: A
a.Formal and actual parameters must have the same name.
b.Formal and actual parameters must have different names.
c.A formal parameter is declared within the called procedure, while an actual parameter is declared in thecalling environment.
d.An actual parameter is declared within the called procedure.
ANS: C
a.CREATE PROCEDURE myproc (x NUMBER, y NUMBER) IS ...
b.CREATE PROCEDURE (x NUMBER, y NUMBER) myproc IS ...
c.CREATE PROCEDURE myproc IS (x NUMBER, y NUMBER) ...
d.CREATE PROCEDURE IS myproc (x NUMBER, y NUMBER) ...
ANS: A
A) bit
B) text
C) ntext
D) image
E) All of above
ANS: E
A) True
B) False
ANS: B
Query - 1
Select distinct hiredate
From hr.employee
Order by hiredate;
Query - 2
Select hiredate
From hr.employees
Group by hiredate
Order by hiredate;
Which of the above query is valid?
A) Query - 1
B) Query - 2
C) Both
ANS: C
A) True
B) False
ANS: A
A) Distinct
B) Count (*)
C) Average()
D) None of above
ANS: B
A) with aggregates
B) with order by
C) without order by
D) without aggregates
ANS: D
Select count(*) as X
from Table_Name
Group by ()
A) Valid
B) Invalid
ANS: A
A) Having
B) Group By
C) Both of above
D) None of above
ANS: B
A) True
B) False
ANS: A