Performing SQL Operations from PL/SQL - questions and answers

Performing SQL Operations from PL/SQL - questions and answers


1) Which of the following returns the current value in a specified sequence.

A) CURRVAL
B) NEXTVAL
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) CURRVAL




2) Which Operator Returns TRUE if a subquery returns at least one row?

A) EXISTS
B) IN
C) IS NULL
D) LIKE
View Answer / Hide Answer

ANSWER: A) EXISTS




3) Which operators combine the results of two queries into one result?

A) Set operator
B) Row Operator
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: A) Set operator




4) Which of the following returns all distinct rows selected by either query?

A) INTERSECT
B) MINUS
C) UNION
D) UNION ALL
View Answer / Hide Answer

ANSWER: C) UNION




5) Which of the following retains duplicate rows in the result of a query or in an aggregate expression?

A) ALL
B) DISTINCT
C) PRIOR
D) None of the above
View Answer / Hide Answer

ANSWER: A) ALL




6) Which of the following executes the query and identifies the result set, consisting of all rows that meet the query search criteria.

A) Fetching with a Cursor
B) Opening a cursor
C) Fetching bulk data with a cursor
D) None of the above
View Answer / Hide Answer

ANSWER: B) Opening a cursor




7) How many attributes does every explicit cursor and cursor variable have?

A) 3
B) 2
C) 4
D) 5
View Answer / Hide Answer

ANSWER: C) 4




8) Which attribute returns NULL?

A) %FOUND
B) %ISOPEN
C) %NOTFOUND
D) %ROWCOUNT
View Answer / Hide Answer

ANSWER: A) %FOUND




9) With PL/SQL, it is very simple to issue a query, retrieve each row of the result into a %ROWTYPE record, and process each row in a loop.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




10) A subquery is a query (usually enclosed by parentheses) that appears within another SQL data manipulation statement.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




11) You use cursor variables to pass query result sets between PL/SQL stored subprograms and various clients.

A) Yes
B) No
View Answer / Hide Answer

ANSWER: A) Yes




12) Which statements are used to control a cursor variable?

A) OPEN-FOR
B) FETCH
C) CLOSE
D) All mentioned above
View Answer / Hide Answer

ANSWER: D) All mentioned above




13) Which statement associates a cursor variable with a multi-row query, executes the query, and identifies the result set?

A) OPEN-FOR
B) FETCH
C) CLOSE
D) All mentioned above
View Answer / Hide Answer

ANSWER: A) OPEN-FOR




14) The CLOSE statement enables a cursor variable and makes the associated result set undefined.

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False




15) LOB parameters are not permitted in a server-to-server RPC.

A) Yes
B) No
View Answer / Hide Answer

ANSWER: A) Yes




16) A nested cursor is implicitly opened when the containing row is fetched from the parent cursor. The nested cursor is closed in which of the following case(s)?

A) The nested cursor is explicitly closed by the user
B) The parent cursor is reexecuted
C) The parent cursor is closed
D) The parent cursor is canceled
E) All mentioned above
F) None of the above
View Answer / Hide Answer

ANSWER: E) All mentioned above




17) Which operations cannot be performed on cursor expressions?

A) BIND
B) EXECUTE
C) Both A & B
D) None of the above
View Answer / Hide Answer

ANSWER: C) Both A & B




18) Cursor attributes are not affected by autonomous transactions.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True


Post your comment