SQL Operations - PL/SQL (MCQ) questions and answers
Here, you can read SQL Operations multiple choice questions and answers with explanation.
1) 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)? - Published on 09 Jul 15
a. The nested cursor is explicitly closed by the user
b. The parent cursor is re-executed
c. The parent cursor is closed
d. The parent cursor is canceled
e. All mentioned above
Answer
Explanation
|
ANSWER: All mentioned above
Explanation: No explanation is available for this question!
|
|
2) A subquery is a query (usually enclosed by parentheses) that appears within another SQL data manipulation statement. - Published on 09 Jul 15
a. True
b. False
Answer
Explanation
|
ANSWER: True
Explanation: On evaluation a value or a set of values to the statement is provided by the subquery. The WHERE clause is used by the subqueries. An evaluation which is done once for each table is carried out by the subquery and a correlated subquery evaluates only once for for each of the rows.
|
|
3) You use cursor variables to pass query result sets between PL/SQL stored subprograms and various clients. - Published on 09 Jul 15
a. Yes
b. No
Answer
Explanation
|
ANSWER: Yes
Explanation: You use cursor variables to pass query result sets between PL/SQL stored subprograms and client programs because any client program or PL/SQL does not own a result set, a pointer is shared in the work area where the result set will be stored.
|
|
4) The CLOSE statement enables a cursor variable and makes the associated result set undefined. - Published on 09 Jul 15
a. True
b. False
Answer
Explanation
|
ANSWER: False
Explanation: The above statement is false. The correct statement is: The CLOSE statement disables the cursor, and the result set becomes undefined.
|
|
5) LOB parameters are not permitted in a server-to-server RPC. - Published on 09 Jul 15
a. Yes
b. No
Answer
Explanation
|
ANSWER: Yes
Explanation: No explanation is available for this question!
|
|
6) Which statement associates a cursor variable with a multi-row query, executes the query, and identifies the result set? - Published on 09 Jul 15
a. OPEN-FOR
b. FETCH
c. CLOSE
d. All mentioned above
Answer
Explanation
|
ANSWER: OPEN-FOR
Explanation: The query associated with a cursor variable executes using the OPEN-FOR statement. It helps in identifying the result set.
|
|
7) Which of the following executes the query and identifies the result set, consisting of all rows that meet the query search criteria. - Published on 09 Jul 15
a. Fetching with a Cursor
b. Opening a cursor
c. Fetching bulk data with a cursor
d. None of the above
Answer
Explanation
|
ANSWER: Opening a cursor
Explanation: Once we have declared the cursor the next thing would be to open the cursor. The cursor is opened with the OPEN statement. Syntax: OPEN cursor_name;
|
|
8) In which of the following, do you specify the same parameters in the same order as they are declared in the procedure? - Published on 09 Jul 15
a. Positional notation
b. Named notation
c. Mixed notation
d. All mentioned above
Answer
Explanation
|
ANSWER: Positional notation
Explanation: Calling a stored procedure by simply just passing the parameter values and assuming that the values will be associated with the parameters in the order of the declaration is known as positional notation. In this notation the value which is passed first is associated with the first parameter, the second value with the second parameter and so on so forth. Here, the values must be passed in a proper order in a stored procedure.
|
|
9) Cursor attributes are not affected by autonomous transactions. - Published on 07 Jul 15
a. True
b. False
Answer
Explanation
|
ANSWER: True
Explanation: The autonomous transactions allow to interfere in the working of triggers and cursors. The working of either does not change.
|
|
10) Cursor attributes are not affected by autonomous transactions. - Published on 08 Jul 15
a. True
b. False
Answer
Explanation
|
ANSWER: True
Explanation: The autonomous transactions allow to interfere in the working of triggers and cursors. The working of either does not change.
|
|