PL-SQL-Objective-Questions-NareshIT

PL/SQL Objective Questions 2

PL SQL Objective Questions 2

Which of the following are correct results of a Boolean expression?

  1. TRUE or FALSE
  2. 0 or 1
  3. YES or NO
  4. TRUE, FALSE or NULL

Ans: 4


Which one of these operators does not have the same precedence as the others?

  1. BETWEEN
  2. AND
  3. LIKE
  4. IS NULL

Ans: 2


What are the two types of case expressions?

  1. Simple and Compound expression
  2. Simple and Complex expression
  3. Simple and Searched expression
  4. Simple and Multiple expressions

Ans: 3


Which of the following operators has the highest precedence?

  1. BETWEEN
  2. NOT
  3. **
  4. ||

Ans: 3


What happens if the none of the selector values match the selector in a simple case expression?

  1. The CASE statement returns NULL.
  2. An error is thrown.
  3. It looks for an else statement. If no else clause is there, it returns NULL.
  4. It looks for an else statement. If no else clause is there, it throws an error.

Ans: 3


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


Where can a % be used in LIKE conditions in PL/SQL?

  1. To match 1 character
  2. To match 0 or more character
  3. To match 1 or more character
  4. To match 0 or 1 character

Ans: 2


How is comparison made in Boolean character expression?

  1. Comparisons are based on the binary values of each byte in the string.
  2. Comparisons are based on the character values of each byte in the string.
  3. Comparisons are based on the binary values of each character in the string.
  4. Comparisons are based on the character values of each character in the string.

Ans: 1


Which of the following operators does a logical expression use?

  1. AND, OR
  2. AND, OR, NOR
  3. AND, OR, NOT
  4. AND, OR, NOR, NOT

Ans: 3


How many rows can a SELECT query inside a PL/SQL execution block return?

  1. One to Ten
  2. One only
  3. One or many
  4. One or Two

Ans: 2


Which of the following statements does PL/SQL not support?

  1. DML commands
  2. DDL commands like CREATE TABLE, ALTER TABLE
  3. SELECT statement
  4. Transaction statements like COMMIT, ROLLBACK

Ans: 2


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


Which of the statements must be used inside a PL/SQL block to remove data from a table?

  1. DROP
  2. MERGE
  3. DROP
  4. DELETE

Ans: 4


What can the VALUES clause of an INSERT statement have inside a PL/SQL block?

  1. Column names and data
  2. PL/SQL variables or constants
  3. Scalar PL/SQL variables only
  4. PL/SQL constants only

Ans: 2


What is a savepoint inside a PL/SQL block used for?

  1. To rollback the entire transaction
  2. To rollback until the savepoint and end the transaction
  3. To rollback until the savepoint only
  4. To commit or rollback until the savepoint

Ans: 3


Which of the following clause is not mandatory while using a SQL SELECT statement?

  1. SELECT
  2. INTO
  3. FROM
  4. WHERE

Ans: 4


Which of the DML statements can be used inside a PL/SQL block?

  1. INSERT, UPDATE, DELETE or MERGE
  2. INSERT or UPDATE only
  3. INSERT, UPDATE or DELETE
  4. INSERT only

Ans: 1


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


Using which of the following clauses is the MERGE condition specified?

  1. INTO
  2. USING
  3. ON
  4. WHEN

Ans: 3


How can a user defined record be created in PL/SQL?

  1. Using TYPE statement
  2. Using %ROWTYPE
  3. Using %TYPE
  4. Using CREATE TYPE statement

Ans: 1


What is the initial value for a record variable declared with RECORD Type?

  1. Value that is stored in the database
  2. Zero for all fields
  3. NULL for all fields
  4. NULL unless a different initial value is specified for it

Ans: 3


Which of the following is not TRUE about using records for database inserts or updates?

  1. If the VALUES clause of an INSERT statement contains a record variable, no other clause
  2. If the INTO sub clause of a RETURNING clause contains a record variable, other variable are allowed
  3. Record variables are not allowed in a SELECT list, WHERE clause, or ORDER BY clause.
  4. Record variables are allowed in the VALUES clause of an INSERT statement.

Ans: 2


What is a %ROWTYPE attribute used for?

  1. To declare a record variable that represents a full or partial row of a database table.
  2. To declare a record variable that represents a full row of a database table only.
  3. To declare a record variable that represents a partial row of a database table only.
  4. To declare a record variable from another record variable.

Ans: 1


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


Which of the following about %ROWTYPE attribute is not true?

  1. For every column of the full or partial row, the record has a field with the same name and data type.
  2. If the structure of the row changes, then the structure of the record changes accordingly.
  3. The record fields inherit the constraints of the corresponding columns.
  4. The record fields do not inherit the initial values of the corresponding columns

Ans: 3


Which of the following is optional while using IF-THEN-ELSIF statements?

  1. END IF
  2. ELSE
  3. THEN
  4. ELSIF

Ans: 2


Read More PL/SQL Objective Questions and Answers

[table id=66 /]