Contents
PL SQL Objective Questions
Which of the following is true about the execution section of a PL/SQL block?
- It is enclosed between the keywords BEGIN and END
 - It is a mandatory section.
 - It consists of the executable PL/SQL statements.
 - All of the above.
 
Ans: 4
Which of the following is true about PL/SQL programs?
- PL/SQL programs can exist with or without any SQL statements.
 - PL/SQL programs can exist only with any SQL statements.
 - PL/SQL programs can exist only without any SQL statements.
 - SQL programs can exist only with PL/SQL statement
 
Ans: 1
What are composite variables in PL/SQL?
- Native datatypes
 - Variables having internal components
 - Scalar variables
 - User defined datatypes
 
Ans: 2
How many parts of a PL/SQL block are optional?
- 2
 - 1
 - 0
 - 3
 
Ans: 1
What is an anonymous block in PL/SQL?
- A PL/SQL unit without declaration
 - A PL/SQL unit without a body to execute
 - A PL/SQL unit without an exception handler
 - 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?
- Set serveroutput on
 - Showserveroutput on
 - Set output on
 - Set PL/SQL on
 
Ans: 1
How does an execution block start and end in PL/SQL?
- Starts with START and ends with END
 - Starts with BEGIN and ends with END
 - Starts with START and ends with ; (semi colon)
 - Starts with BEGIN and ends with ; (semi colon)
 
Ans: 2
How can a PL/SQL block be executed?
- By using a semi colon at the end.
 - By using a colon at the end.
 - By using a slash (/) at the end.
 - By pressing “Enter”
 
Ans: 3
Which of the following is not a subtype of PLS_INTEGER datatype?
- POSITIVEN
 - NATURALN
 - SIGN_TYPE
 - SIMPLE_N_INTEGER
 
Ans: 4
Which of the following is not true about keywords?
- Reserved words and keywords are identifiers that have special meaning in PL/SQL.
 - Reserved words cannot be used as identifiers.
 - Keywords can be used as identifiers, but it is not recommended.
 - 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?
- Digits
 - The characters $, #, _,
 - Punctuation or hyphens
 - Letters and Digits
 
Ans: 3
What is an identifier in PL/SQL?
- Identifier is a character, or character combination, that has a special meaning in PL/SQL.
 - Identifiers provide a named reference to PL/SQL objects.
 - Identifier is a value that is neither represented by an literal nor calculated from other values.
 - 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?
- By two hyphens (–)
 - Starts with /* and ends with */
 - Starts with /$ and ends with $/
 - Starts with /^ and ends with ^/
 
Ans: 2
Which of the following is an example of Pre-defined identifier?
- The exception INVALID_NUMBER
 - EXCEPTION keyword
 - BEGIN and END keywords
 - LastName
 
Ans: 1
What are the different types of identifiers?
- Pre-defined and system defined identifier
 - Pre-defined, user defined and reserved keywords
 - User defined and system defined identifier
 - 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?
- Subprogram
 - Session
 - Block
 - Schema
 
Ans: 3
Where can a variable be assigned values in PL/SQL?
- Declaration block only
 - Executable block only
 - Declaration and Executable only
 - Executable and Exception block only
 
Ans: 3
How can values be assigned to a variable in PL/SQL?
- Using assignment operator only.
 - Using a subprogram only.
 - Using SELECT..INTO statement, a subprogram or an assignment operator.
 - Using SELECT..INTO statement, or an assignment operator only.
 
Ans: 3
How should any declaration statement end in PL/SQL?
- Using a colon (:)
 - Using a period (.)
 - Using a semi colon (;)
 - Using a slash (/)
 
Ans: 3
Which of the following correctly describes the use of a %TYPE attribute?
- Lets the user declare a data item of the same data type as a previously declared variable or column.
 - Lets the user declare a data item of different data type as a previously declared variable or column.
 - Lets the user declare a data item of the same data type as a previously declared row of data.
 - 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?
- After the SELECT and before INTO
 - After the SELECT and after INTO
 - After the SELECT and FROM clause and before INTO clause
 - After the SELECT, FROM clause and INTO clause and before WHERE clause
 
Ans: 1
What is scope and visibility of an identifier?
- The region of a PL/SQL unit from which the identifier can be referenced.
 - The region of a PL/SQL unit from which the identifier can be referenced without qualifying it.
 - The region of a PL/SQL unit from which the identifier can be referenced.
 - 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