Oracle PL/SQL and SQL Fundamentals

A comprehensive quiz covering Oracle PL/SQL syntax, SQL statements, cursor operations, loop constructs, NULL handling, and database concepts.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which clause in a query limits the rows selected?

  1. ORDER BY
  2. FROM
  3. SELECT
  4. WHERE
Question 2 True/False

The INTO clause is mandatory for SELECT statements within PL/SQL blocks.

  1. True
  2. False
Question 3 True/False

PL/SQL blocks may be nested within exception block.

  1. True
  2. False
Question 4 True/False

The following block statement will run successfully SCOTT.EMP.EMPNO := 1234;

  1. True
  2. False
Question 5 True/False

5 + NULL evaluates to 5 and ‘PL/’ || NULL || ‘SQL’ evaluates to ‘PL/SQL’

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

what is the concatenation operator in dbms_output.put_line() function

  1. +
  2. |
  3. ||
  4. .
Question 7 Multiple Choice (Single Answer)

what will be the output of the following block: set serveroutput on; declare a int; b int; begin a:=NULL; b:=NULL; if a< b then dbms_output.put_line('y'); else dbms_output.put_line('n'); end if; end;

  1. y
  2. n
  3. error
  4. no output
Question 8 Multiple Choice (Single Answer)

which statement is used to break a loop in pl/sql

  1. exit
  2. break
  3. stop
  4. continue
Question 9 Multiple Choice (Single Answer)

which of the following lines is invalid: FOR i IN 1…256 LOOP --Line 1 x := x + i ; --Line 2 i := I + 5; --Line 3 END LOOP; --Line 4

  1. line 1
  2. line 2
  3. line 3
  4. line 4
Question 10 Multiple Choice (Single Answer)

which of the following is not an explicit cursor attribute

  1. %notfound
  2. %rowcount
  3. %isopen
  4. %isclose
Question 11 Multiple Choice (Single Answer)

DUP_VAL_ON_INDEX corressponds to which of the following error.

  1. ORA-01427
  2. ORA-01476
  3. ORA-00001
  4. ORA-01001
Question 12 Multiple Choice (Single Answer)

Which Database is oldest database in world ?

  1. fox pro
  2. oracle
  3. db2
  4. sql server
Question 13 Multiple Choice (Single Answer)

Which of the following statements contains an error?

  1. SELECT * FROM emp WHERE empid = 493945;
  2. SELECT empid FROM emp WHERE empid= 493945;
  3. SELECT empid FROM emp;
  4. SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;
Question 14 Multiple Choice (Single Answer)

The user issues the following statement. What will be displayed if the EMPID selected is 60494? SELECT DECODE(empid,38475, “Terminated”,60494, “LOA”, “ACTIVE”) FROM emp;

  1. ACTIVE
  2. LOA
  3. TERMINATED
  4. 38475
Question 15 Multiple Choice (Single Answer)

The default character for specifying runtime variables in SELECT statements is :-

  1. percentage sign
  2. Quotation marks
  3. Ampersand
  4. Ellipses
Question 16 True/False

Creating a foreign-key constraint between columns of two tables defined with two different datatypes will produce an error.

  1. True
  2. False
Question 17 True/False

SELECT (TO_CHAR(NVL(SQRT(59483), “INVALID”)) FROM DUAL is a valid SQL statement.

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

Which function below can best be categorized as similar in function to an IF-THEN-ELSE statement?

  1. NEW_TIME
  2. Decode
  3. ROWIDTOCHAR
  4. SQRT
Question 19 True/False

MAXVALUE is a valid parameter for sequence creation.

  1. True
  2. False
Question 20 Multiple Choice (Single Answer)

Dropping a table has which of the following effects on a nonunique index created for the table?

  1. No effect
  2. The index will be rendered invalid
  3. The index will be dropped
  4. The index will contain NULL values.