PL-SQL-Objective-Questions-NareshIT

PL/SQL Multiple Choice Questions

PL/SQL Multiple Choice Questions

How many ELSE clauses can an IF statement have?

  1. 0 or 1
  2. Always 1
  3. 1 or 2
  4. 1 to 10

Ans :  1


 Which of the following is equivalent to multiple IF-ELSIF statements?

  1. LOOP statement
  2. FOR statement
  3. WHILE statement
  4. CASE statement

Ans : 3


Which of the following statements can be used to terminate a PL/SQL loop?

  1. GOTO
  2. EXIT WHEN
  3. CONTINUE WHEN
  4. KILL

Ans : 2


Which of the following is not a PL/SQL unit?

  1. Table
  2. Type
  3. Trigger
  4. Package

Ans : 1


Which of the following is true about scalar data types in PL/SQL?

  1. They hold single values with no internal components.
  2. Examples of scalar data types are NUMBER, DATE, or BOOLEAN.
  3. PL/SQL provides subtypes of data types.
  4. All are true.

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which keyword is used instead of the assignment operator to initialize variables?

  1. NOT NULL
  2. DEFAULT
  3. %TYPE
  4. %ROWTYPE

Ans : 2


Which of the following is used to declare a record?

  1. %ROWTYPE
  2. %TYPE
  3. Both A & B
  4. None of the above

Ans : 1


Which of the following is not true about PL/SQL constants and literals?

  1. A constant holds a value that once declared, does not change in the program.
  2. The CONSTANT declaration cannot impose the NOT NULL constraint.
  3. A constant is declared using the CONSTANT keyword.
  4. A CONSTANT declaration requires an initial value.

Ans : 2


What value will be assigned to the variable declared as − counter binary_integer;

  1. 0
  2. 1
  3. NULL
  4. None of the above.

Ans : 3


Which of the following is not true about PL/SQL decision making structures?

  1. The IF statement associates a condition with a sequence of statements enclosed by THEN and END IF.
  2. The IF statement also adds the keyword ELSE followed by an alternative sequence of statement.
  3. The IF-THEN-ELSIF statement allows you to choose between several alternatives.
  4. PL/SQL does not have a CASE statement

Ans : 4


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


What is the initial value of index for a reverse for loop?

  1. UPPER bound
  2. Lower bound
  3. 1
  4. Upper bound-Lower bound/2

Ans : 1


Which of the following is explicit numeric, string, or BOOLEAN value not represented  identifier?

  1. Delimiters
  2. Literals
  3. Comments
  4. None of the above

Ans : 2


Which of the following is not true about large object data types and in PL/SQL?

  1. BFILE is used to store large binary objects in operating system files outside the database.
  2. BLOB is used to store character data in the database.
  3. CLOB is used to store large blocks of character data in the database.
  4. NCLOB is used to store large blocks of NCHAR data in the database.

Ans : 2


Which of the following is true about comments in PL/SQL?

  1. Comments are explanatory statements.
  2. The PL/SQL single-line comments start with the delimiter — (double hyphen)
  3. Multi-line comments are enclosed by /* and */.
  4. All of the above.

Ans :  4


Which of the following is not true about labeling PL/SQL loops?

  1. PL/SQL loops can be labeled.
  2. The label should be enclosed by angle brackets (< and >).
  3. The label name appears at the beginning of the LOOP statement.
  4. The label name can also appear at the end of the LOOP statement or with an EXIT statement.

Ans : 2


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which is a simple or compound symbol that has a special meaning to PL/SQL?

  1. Delimiters
  2. Identifiers
  3. Literals
  4. Comments

Ans :  1


PL/SQL is a procedural language that has which of the following advantages?

  1. Integration with database
  2. Better Performance
  3. Portability
  4. All mentioned above

Ans :   4


Can BOOLEAN datatype be used in functions that are called from SQL statements?

  1. Yes
  2. No
  3. Depends upon
  4. Invalid option

Ans :  2


Which data type supports only sequential access of objects?

  1. LONG
  2. LOB
  3. Both A & B
  4. None of the above

Ans :  1


Is it possible to define a CONSTANT value in a record?

  1. Yes
  2. No
  3. Depends upon
  4. Invalid option

Ans :  2


Attend Free Demo and Learn   SQL SERVER ONLINE TRAINING   by Real-Time Expert


Which datatypes can be used with a RECORD Type?

  1. NUMBER,VARCHAR2
  2. %TYPE OR %ROWTYPE
  3. REF,CURSOR
  4. BOTH A & B

Ans :  4


Which of the following correctly defines a cursor?

  1. A cursor is a pointer to a temporary work area created in the system memory
  2. A cursor is a pointer to a permanent work area created in the system memory
  3. A cursor is a pointer to a temporary area DDL statement.
  4. A cursor is a pointer to a permanent work area created in DDL statement.

Ans :  1


Read More PL/SQL Objective Questions and Answers

[table id=66 /]