PL-SQL-Objective-Questions-NareshIT

PL/SQL Objective Questions 1

  PL SQL Objective Questions

 Which of the following is true about the execution section of a PL/SQL block?

  1. It is enclosed between the keywords BEGIN and END
  2. It is a mandatory section.
  3. It consists of the executable PL/SQL statements.
  4. All of the above.

Ans: 4


Which of the following is true about PL/SQL programs?

  1. PL/SQL programs can exist with or without any SQL statements.
  2. PL/SQL programs can exist only with any SQL statements.
  3. PL/SQL programs can exist only without any SQL statements.
  4. SQL programs can exist only with PL/SQL statement

Ans: 1


What are composite variables in PL/SQL?

  1. Native datatypes
  2. Variables having internal components
  3. Scalar variables
  4. User defined datatypes

Ans: 2


How many parts of a PL/SQL block are optional?

  1. 2
  2. 1
  3. 0
  4. 3

Ans: 1


What is an anonymous block in PL/SQL?

  1. A PL/SQL unit without declaration
  2. A PL/SQL unit without a body to execute
  3. A PL/SQL unit without an exception handler
  4. PL/SQL unit without a name

Ans: 4


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


Which command should be used to turn on the output of PL/SQL commands in SQL*Plus?

  1. Set serveroutput on
  2. Showserveroutput on
  3. Set output on
  4. Set PL/SQL on

Ans: 1


How does an execution block start and end in PL/SQL?

  1. Starts with START and ends with END
  2. Starts with BEGIN and ends with END
  3. Starts with START and ends with ; (semi colon)
  4. Starts with BEGIN and ends with ; (semi colon)

Ans: 2


How can a PL/SQL block be executed?

  1. By using a semi colon at the end.
  2. By using a colon at the end.
  3. By using a slash (/) at the end.
  4. By pressing “Enter”

Ans: 3


Which of the following is not a subtype of PLS_INTEGER datatype?

  1. POSITIVEN
  2. NATURALN
  3. SIGN_TYPE
  4. SIMPLE_N_INTEGER

Ans: 4


Which of the following is not true about keywords?

  1. Reserved words and keywords are identifiers that have special meaning in PL/SQL.
  2. Reserved words cannot be used as identifiers.
  3. Keywords can be used as identifiers, but it is not recommended.
  4. Reserved keywords can be used as ordinary user-defined identifiers.

Ans: 4


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


Which of the following is not allowed in an identifier name?

  1. Digits
  2. The characters $, #, _,
  3. Punctuation or hyphens
  4. Letters and Digits

Ans: 3


What is an identifier in PL/SQL?

  1. Identifier is a character, or character combination, that has a special meaning in PL/SQL.
  2. Identifiers provide a named reference to PL/SQL objects.
  3. Identifier is a value that is neither represented by an literal nor calculated from other values.
  4. Identifier is a string that is used to help other application developers understand the source text.

Ans: 2


How are multi-line comments defined in PL/SQL?

  1. By two hyphens (–)
  2. Starts with /* and ends with */
  3. Starts with /$ and ends with $/
  4. Starts with /^ and ends with ^/

Ans: 2


Which of the following is an example of Pre-defined identifier?

  1. The exception INVALID_NUMBER
  2. EXCEPTION keyword
  3. BEGIN and END keywords
  4. LastName

Ans: 1


What are the different types of identifiers?

  1. Pre-defined and system defined identifier
  2. Pre-defined, user defined and reserved keywords
  3. User defined and system defined identifier
  4. Pre defined and Post defined identifier

Ans: 2


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


What is the scope of a local declaration?

  1. Subprogram
  2. Session
  3. Block
  4. Schema

Ans: 3


Where can a variable be assigned values in PL/SQL?

  1. Declaration block only
  2. Executable block only
  3. Declaration and Executable only
  4. Executable and Exception block only

Ans: 3


How can values be assigned to a variable in PL/SQL?

  1. Using assignment operator only.
  2. Using a subprogram only.
  3. Using SELECT..INTO statement, a subprogram or an assignment operator.
  4. Using SELECT..INTO statement, or an assignment operator only.

Ans: 3


How should any declaration statement end in PL/SQL?

  1. Using a colon (:)
  2. Using a period (.)
  3. Using a semi colon (;)
  4. Using a slash (/)

Ans: 3


Which of the following correctly describes the use of a %TYPE attribute?

  1. Lets the user declare a data item of the same data type as a previously declared variable or column.
  2. Lets the user declare a data item of different data type as a previously declared variable or column.
  3. Lets the user declare a data item of the same data type as a previously declared row of data.
  4. User declares a data item of different data type as a previously declared row of data.

Ans: 1


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


While using SELECT INTO statements where are the database columns specified?

  1. After the SELECT and before INTO
  2. After the SELECT and after INTO
  3. After the SELECT and FROM clause and before INTO clause
  4. After the SELECT, FROM clause and INTO clause and before WHERE clause

Ans: 1


What is scope and visibility of an identifier?

  1. The region of a PL/SQL unit from which the identifier can be referenced.
  2. The region of a PL/SQL unit from which the identifier can be referenced without qualifying it.
  3. The region of a PL/SQL unit from which the identifier can be referenced.
  4. The region of a PL/SQL unit from which the identifier can be referenced by qualifying it.

Ans: 1


Read More PL/SQL Objective Questions and Answers

[table id=66 /]