Oracle PLSQL Online Test Series 2, Oracle PLSQL Online Exam
Finish Quiz
0 of 30 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
Information
Oracle PLSQL Online Test Series 2, Oracle PLSQL Online Exam Series 2 , Free Oracle PLSQL Quiz, Online Oracle PLSQL, online Test Quiz 2. Oracle PLSQL Online Test 2 Question and Answers 2024. Oracle PLSQL online Test Quiz 2. Oracle PLSQL Test 2 Free Mock Test 2024. Oracle PLSQL Online Test-2 Question and Answers in PDF. The Oracle PLSQL online mock test paper is free for all students. Oracle PLSQL Online Test is very useful for exam preparation and getting for Rank. Oracle PLSQL Online Test 2 Question and Answers in English. Oracle PLSQL Online Test for topic via String Handling Mode. Here we are providing Oracle PLSQL Online Test in English Now Test your self for “Oracle PLSQL Online Test in English” Exam by using below quiz…
This paper has 30 questions.
Time allowed is 30 minutes.
The Oracle PLSQL Online Test is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 30 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- Answered
- Review
-
Question 1 of 30
1. Question
Which of the following Correct syntax of Nested table?
Correct
Incorrect
-
Question 2 of 30
2. Question
Which of the following method retrieves the element values of the array into a Datum[] array?
Correct
The getOracleArray method is an Oracle-specific extension that is not specified in the standard Array interface. The getOracleArray method retrieves the element values of the array into a Datum[] array. The elements are of the oracle.sql.* data type corresponding to the SQL type of the data in the original array. For an array of structured objects, this method will use oracle.sql.STRUCT instances for the elements. Oracle also provides a getOracleArray(index,count) method to get a subset of the array elements.
Incorrect
The getOracleArray method is an Oracle-specific extension that is not specified in the standard Array interface. The getOracleArray method retrieves the element values of the array into a Datum[] array. The elements are of the oracle.sql.* data type corresponding to the SQL type of the data in the original array. For an array of structured objects, this method will use oracle.sql.STRUCT instances for the elements. Oracle also provides a getOracleArray(index,count) method to get a subset of the array elements.
-
Question 3 of 30
3. Question
Which of the following is the correct syntax of creating Object?
Correct
Incorrect
-
Question 4 of 30
4. Question
Which of the following is the correct syntax of Associative array of number?
Correct
A PL/SQL associative array is a collection type that associates a unique key with a value. An associative array has the following characteristics:
– An associative array type must be defined before array variables of that array type can be declared. Data manipulation occurs in the array variable.
– The array does not need to be initialized; simply assign values to array elements.
– There is no defined limit on the number of elements in the array; it grows dynamically as elements are added.
– The array can be sparse; there can be gaps in the assignment of values to keys.
– An attempt to reference an array element that has not been assigned a value results in an exception.
– Use the TYPE IS TABLE OF statement to define an associative array type.Syntax:
>>-TYPE–assoctype–IS TABLE OF—-datatype———————>
>–INDEX BY–+-BINARY_INTEGER————–+——————->< +-PLS_INTEGER-----------------+ '-VARCHAR2--(--n--+------+--)-' +-BYTE-+ '-CHAR-' where, - TYPE assoctype specifies an identifer for the array type. - Datatype specifies a supported data type, such as VARCHAR2, NUMBER, RECORD, VARRAY, or associative array type. The %TYPE attribute and the %ROWTYPE attribute are also supported. - INDEX BY specifies that the associative array is to be indexed by one of the data types introduced by this clause. - BINARY INTEGER and PLS_INTEGER are Integer numeric data. VARCHAR2 (n[BYTE|CHAR]) : A variable-length character string of maximum length n code units, which may range from 1 to 32 672 BYTE or from 1 to 8 168 CHAR.
Incorrect
A PL/SQL associative array is a collection type that associates a unique key with a value. An associative array has the following characteristics:
– An associative array type must be defined before array variables of that array type can be declared. Data manipulation occurs in the array variable.
– The array does not need to be initialized; simply assign values to array elements.
– There is no defined limit on the number of elements in the array; it grows dynamically as elements are added.
– The array can be sparse; there can be gaps in the assignment of values to keys.
– An attempt to reference an array element that has not been assigned a value results in an exception.
– Use the TYPE IS TABLE OF statement to define an associative array type.Syntax:
>>-TYPE–assoctype–IS TABLE OF—-datatype———————>
>–INDEX BY–+-BINARY_INTEGER————–+——————->< +-PLS_INTEGER-----------------+ '-VARCHAR2--(--n--+------+--)-' +-BYTE-+ '-CHAR-' where, - TYPE assoctype specifies an identifer for the array type. - Datatype specifies a supported data type, such as VARCHAR2, NUMBER, RECORD, VARRAY, or associative array type. The %TYPE attribute and the %ROWTYPE attribute are also supported. - INDEX BY specifies that the associative array is to be indexed by one of the data types introduced by this clause. - BINARY INTEGER and PLS_INTEGER are Integer numeric data. VARCHAR2 (n[BYTE|CHAR]) : A variable-length character string of maximum length n code units, which may range from 1 to 32 672 BYTE or from 1 to 8 168 CHAR.
-
Question 5 of 30
5. Question
Which of the following is the correct syntax of varray?
Correct
Incorrect
-
Question 6 of 30
6. Question
________is a collection type ,If the TYPE statement contains an INDEX BY clause.
Correct
If the TYPE statement contains an INDEX BY clause, the collection type is an associative array. A PL/SQL associative array is a collection type that associates a unique key with a value.
Incorrect
If the TYPE statement contains an INDEX BY clause, the collection type is an associative array. A PL/SQL associative array is a collection type that associates a unique key with a value.
-
Question 7 of 30
7. Question
Which of the following Correct syntax of initializing a nested table of numbers?
Correct
Incorrect
-
Question 8 of 30
8. Question
Which of the following Delete method is used to remove all elements from Collection?
Correct
Remove all elements from a collection; use the DELETE method without any arguments. This form of DELETE works with all three kinds of collections.
l_names.DELETE;Incorrect
Remove all elements from a collection; use the DELETE method without any arguments. This form of DELETE works with all three kinds of collections.
l_names.DELETE; -
Question 9 of 30
9. Question
Which of the following are Collection Exceptions?
Correct
A collection is an ordered group of elements having the same data type. Each element is identified by a unique subscript that represents its position in the collection. Following are the collection exceptions:
1. COLLECTION_IS_NULL : You try to operate on an atomically null collection.
2. NO_DATA_FOUND : A subscript designates an element that was deleted, or a nonexistent element of an associative array.
3. SUBSCRIPT_BEYOND_COUNT : A subscript exceeds the number of elements in a collection.
4. SUBSCRIPT_OUTSIDE_LIMIT : A subscript is outside the allowed range.
5. VALUE_ERROR : A subscript is null or not convertible to the key type. This exception might occur if the key is defined as a PLS_INTEGER range, and the subscript is outside this range.Incorrect
A collection is an ordered group of elements having the same data type. Each element is identified by a unique subscript that represents its position in the collection. Following are the collection exceptions:
1. COLLECTION_IS_NULL : You try to operate on an atomically null collection.
2. NO_DATA_FOUND : A subscript designates an element that was deleted, or a nonexistent element of an associative array.
3. SUBSCRIPT_BEYOND_COUNT : A subscript exceeds the number of elements in a collection.
4. SUBSCRIPT_OUTSIDE_LIMIT : A subscript is outside the allowed range.
5. VALUE_ERROR : A subscript is null or not convertible to the key type. This exception might occur if the key is defined as a PLS_INTEGER range, and the subscript is outside this range. -
Question 10 of 30
10. Question
Which of the following attribute is used to declare a record that represents a row in a database table, without listing all the columns?
Correct
The %ROWTYPE attribute is used to declare a record that represents a row in a database table, without listing all the columns. The %ROWTYPE attribute provides a record type that represents a row in a database table. The record can store an entire row of data selected from the table or fetched from a cursor or cursor variable. Fields in a record and corresponding columns in a row have the same names and datatypes.
Incorrect
The %ROWTYPE attribute is used to declare a record that represents a row in a database table, without listing all the columns. The %ROWTYPE attribute provides a record type that represents a row in a database table. The record can store an entire row of data selected from the table or fetched from a cursor or cursor variable. Fields in a record and corresponding columns in a row have the same names and datatypes.
-
Question 11 of 30
11. Question
Record variables are allowed only in the following places:
Correct
Record variables are allowed only in the following places:
1. On the right side of the SET clause in an UPDATE statement because “SET” only found in an UPDATE statement.
2. In the VALUES clause of an INSERT statement because “VALUES” only found in an INSERT statement.
3. In the INTO sub-clause of a RETURNING clause.Incorrect
Record variables are allowed only in the following places:
1. On the right side of the SET clause in an UPDATE statement because “SET” only found in an UPDATE statement.
2. In the VALUES clause of an INSERT statement because “VALUES” only found in an INSERT statement.
3. In the INTO sub-clause of a RETURNING clause. -
Question 12 of 30
12. Question
Which of following way nested cursor will closed?
Correct
A nested cursor is implicitly opened when the cursor expression is evaluated. For example, if the cursor expression appears in a select list, a nested cursor will be opened for each row fetched by the query. The nested cursor is closed only when:
– The nested cursor is explicitly closed by the user.
– The parent cursor is re-executed.
– The parent cursor is closed.
– The parent cursor is cancelled.
– An error arises during fetch on one of its parent cursors (it is closed as part of the clean-up).The nested cursor is controlled implicitly while the parent cursor is being processed. It is opened when the containing row is fetched from the parent cursor, and it is closed either explicitly by the user or when the parent cursor is re-executed, closed, cancelled or returns an error during a fetch operation.
Incorrect
A nested cursor is implicitly opened when the cursor expression is evaluated. For example, if the cursor expression appears in a select list, a nested cursor will be opened for each row fetched by the query. The nested cursor is closed only when:
– The nested cursor is explicitly closed by the user.
– The parent cursor is re-executed.
– The parent cursor is closed.
– The parent cursor is cancelled.
– An error arises during fetch on one of its parent cursors (it is closed as part of the clean-up).The nested cursor is controlled implicitly while the parent cursor is being processed. It is opened when the containing row is fetched from the parent cursor, and it is closed either explicitly by the user or when the parent cursor is re-executed, closed, cancelled or returns an error during a fetch operation.
-
Question 13 of 30
13. Question
Which of the following are restrictions to Cursor Expression?
Correct
The following restrictions apply to CURSOR expressions:
– If the enclosing statement is not a SELECT statement, nested cursors can appear only as REF CURSOR arguments of a procedure.
– If the enclosing statement is a SELECT statement, nested cursors can also appear in the outermost select list of the query specification or in the outermost select list of another nested cursor.– Nested cursors cannot appear in views.
– You cannot perform BIND and EXECUTE operations on nested cursors.Incorrect
The following restrictions apply to CURSOR expressions:
– If the enclosing statement is not a SELECT statement, nested cursors can appear only as REF CURSOR arguments of a procedure.
– If the enclosing statement is a SELECT statement, nested cursors can also appear in the outermost select list of the query specification or in the outermost select list of another nested cursor.– Nested cursors cannot appear in views.
– You cannot perform BIND and EXECUTE operations on nested cursors. -
Question 14 of 30
14. Question
Which of the following are not supported to record insert/Updates?
Correct
Incorrect
-
Question 15 of 30
15. Question
Which of the following statement is not used for read only transaction?
Correct
The READ ONLY clause establishes the current transaction as a read-only transaction. This clause established transaction-level read consistency. Read-only transactions are useful for reports that run multiple queries against one or more tables while other users update these same tables. This clause is not supported for the user SYS. That is, queries by SYS will return changes made during the transaction even if SYS has set the transaction to be READ ONLY. Following statements are permitted in a read-only transaction:
– Subqueries–that is, SELECT statements without the for_update_clause
– LOCK TABLE
– SET ROLE
– ALTER SESSION
– ALTER SYSTEMIncorrect
The READ ONLY clause establishes the current transaction as a read-only transaction. This clause established transaction-level read consistency. Read-only transactions are useful for reports that run multiple queries against one or more tables while other users update these same tables. This clause is not supported for the user SYS. That is, queries by SYS will return changes made during the transaction even if SYS has set the transaction to be READ ONLY. Following statements are permitted in a read-only transaction:
– Subqueries–that is, SELECT statements without the for_update_clause
– LOCK TABLE
– SET ROLE
– ALTER SESSION
– ALTER SYSTEM -
Question 16 of 30
16. Question
Which of the following statements are not correct?
Correct
Collection methods cannot be called from SQL statements. Collection methods make collections easier to use, and make your applications easier to maintain. These methods include COUNT, DELETE, EXISTS, EXTEND, FIRST, LAST, LIMIT, NEXT, PRIOR, and TRIM. A collection method is a built-in function or procedure that operates on collections and is called using dot notation.
Incorrect
Collection methods cannot be called from SQL statements. Collection methods make collections easier to use, and make your applications easier to maintain. These methods include COUNT, DELETE, EXISTS, EXTEND, FIRST, LAST, LIMIT, NEXT, PRIOR, and TRIM. A collection method is a built-in function or procedure that operates on collections and is called using dot notation.
-
Question 17 of 30
17. Question
When will be FIRST and LAST collection elements return null values?
Correct
FIRST and LAST return the first and last (smallest and largest) index numbers in a collection that uses integer subscripts. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same index value.
Incorrect
FIRST and LAST return the first and last (smallest and largest) index numbers in a collection that uses integer subscripts. If the collection is empty, FIRST and LAST return NULL. If the collection contains only one element, FIRST and LAST return the same index value.
-
Question 18 of 30
18. Question
Which of the following statements are not correct about EXTEND Method?
Correct
To increase the size of a nested table or varray, use EXTEND. This procedure has three forms:
1. EXTEND appends one null element to a collection.
2. EXTEND(n) appends n null elements to a collection.
3. EXTEND(n,i) appends n copies of the ith element to a collection.
You cannot use EXTEND with index-by tables. You cannot use EXTEND to add elements to an uninitialized collection. If you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type.Incorrect
To increase the size of a nested table or varray, use EXTEND. This procedure has three forms:
1. EXTEND appends one null element to a collection.
2. EXTEND(n) appends n null elements to a collection.
3. EXTEND(n,i) appends n copies of the ith element to a collection.
You cannot use EXTEND with index-by tables. You cannot use EXTEND to add elements to an uninitialized collection. If you impose the NOT NULL constraint on a TABLE or VARRAY type, you cannot apply the first two forms of EXTEND to collections of that type. -
Question 19 of 30
19. Question
Record variables are not allowed in following Clauses.
Correct
Record variables are not allowed in SELECT list, WHERE clause and GROUP BY clause.
Incorrect
Record variables are not allowed in SELECT list, WHERE clause and GROUP BY clause.
-
Question 20 of 30
20. Question
Which of the following statements are correct about EXIST Method?
Correct
EXISTS method returns TRUE if the nth element in a collection exists. It is used to avoid referencing a nonexistent element. EXISTS with DELETE can work with sparse nested tables.
Incorrect
EXISTS method returns TRUE if the nth element in a collection exists. It is used to avoid referencing a nonexistent element. EXISTS with DELETE can work with sparse nested tables.
-
Question 21 of 30
21. Question
Can WITH Clause is similar with Function definition in procedural code.
Correct
The SQL WITH clause is similar in concept to a function definition in procedural code. In a function, we factor the common code, put it all together at one place and call it as many times as needed in the main program. That’s precisely how we use the WITH clause in SQL – factor out the common subquery, put it all together at one place and call it as many times as needed in the main query.
Incorrect
The SQL WITH clause is similar in concept to a function definition in procedural code. In a function, we factor the common code, put it all together at one place and call it as many times as needed in the main program. That’s precisely how we use the WITH clause in SQL – factor out the common subquery, put it all together at one place and call it as many times as needed in the main query.
-
Question 22 of 30
22. Question
An index-by table also called an associative array is a set of _________________ pairs.
Correct
An index-by table, also called an associative array is a set of key-value pairs. Each key is unique, and is used to locate the corresponding value. The key can be either an integer or a string. Using a key-value pair for the first time adds that pair to the associative array. Using the same key with a different value changes the value.
Incorrect
An index-by table, also called an associative array is a set of key-value pairs. Each key is unique, and is used to locate the corresponding value. The key can be either an integer or a string. Using a key-value pair for the first time adds that pair to the associative array. Using the same key with a different value changes the value.
-
Question 23 of 30
23. Question
Which is a default parameter type if it is not explicitly defined?
Correct
If a parameter is not explicitly defined a parameter type, then by default it is an IN type parameter. IN type parameter is used to send values to stored procedures.
Incorrect
If a parameter is not explicitly defined a parameter type, then by default it is an IN type parameter. IN type parameter is used to send values to stored procedures.
-
Question 24 of 30
24. Question
Which method is used to remove (n) elements from the end of collection?
Correct
TRIM procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.TRIM operates on the internal size of a collection. If TRIM encounters deleted elements, it includes them in its tally.
Incorrect
TRIM procedure has two forms. TRIM removes one element from the end of a collection. TRIM(n) removes n elements from the end of a collection. If n is greater than COUNT, TRIM(n) raises SUBSCRIPT_BEYOND_COUNT. You cannot use TRIM with index-by tables.TRIM operates on the internal size of a collection. If TRIM encounters deleted elements, it includes them in its tally.
-
Question 25 of 30
25. Question
Which type of collection exception is raised for situation like “You try to operate on an atomically null collection”?
Correct
A collection is an ordered group of elements having the same data type. Each element is identified by a unique subscript that represents its position in the collection. Following are the collection exceptions:
1. COLLECTION_IS_NULL : You try to operate on an atomically null collection.
2. NO_DATA_FOUND : A subscript designates an element that was deleted, or a nonexistent element of an associative array.
3. SUBSCRIPT_BEYOND_COUNT : A subscript exceeds the number of elements in a collection.
4. SUBSCRIPT_OUTSIDE_LIMIT : A subscript is outside the allowed range.
5. VALUE_ERROR : A subscript is null or not convertible to the key type. This exception might occur if the key is defined as a PLS_INTEGER range, and the subscript is outside this range.Incorrect
A collection is an ordered group of elements having the same data type. Each element is identified by a unique subscript that represents its position in the collection. Following are the collection exceptions:
1. COLLECTION_IS_NULL : You try to operate on an atomically null collection.
2. NO_DATA_FOUND : A subscript designates an element that was deleted, or a nonexistent element of an associative array.
3. SUBSCRIPT_BEYOND_COUNT : A subscript exceeds the number of elements in a collection.
4. SUBSCRIPT_OUTSIDE_LIMIT : A subscript is outside the allowed range.
5. VALUE_ERROR : A subscript is null or not convertible to the key type. This exception might occur if the key is defined as a PLS_INTEGER range, and the subscript is outside this range. -
Question 26 of 30
26. Question
How do you append (n) null elements to a collection?
Correct
EXTEND procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. If EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with associative arrays.
Incorrect
EXTEND procedure has three forms. EXTEND appends one null element to a collection. EXTEND(n) appends n null elements to a collection. EXTEND(n,i) appends n copies of the ith element to a collection. EXTEND operates on the internal size of a collection. If EXTEND encounters deleted elements, it includes them in its tally. You cannot use EXTEND with associative arrays.
-
Question 27 of 30
27. Question
Can nested table extend index -by table with SELECT, INSERT, UPDATE, DELETE operations?
Correct
Yes, nested table can extend index-by table with SELECT, INSERT, UPDATE, DELETE operations. Nested tables are similar to index by table, but these can be stored in database columns, but index by tables cannot be stored in database columns.
Incorrect
Yes, nested table can extend index-by table with SELECT, INSERT, UPDATE, DELETE operations. Nested tables are similar to index by table, but these can be stored in database columns, but index by tables cannot be stored in database columns.
-
Question 28 of 30
28. Question
Which method is used to remove an item of the collection from the given position?
Correct
Guys please improve the Quality..!! (English also)
You’re asking for removing ‘an item’ not removing ‘few/some items’. The answer for this question should be DELETE(n).
DELETE(m,n) would delete itemS between mth and nth element.Incorrect
Guys please improve the Quality..!! (English also)
You’re asking for removing ‘an item’ not removing ‘few/some items’. The answer for this question should be DELETE(n).
DELETE(m,n) would delete itemS between mth and nth element. -
Question 29 of 30
29. Question
Which type of trigger is fired for each row of DML operation?
Correct
A statement trigger is fired once on behalf of the triggering statement, regardless of the number of rows in the table that the triggering statement affects, even if no rows are affected. For example, if a DELETE statement deletes several rows from a table, a statement-level DELETE trigger is fired only once. Statement triggers are useful if the code in the trigger action does not depend on the data provided by the triggering statement or the rows affected. For example, use a statement trigger to:
– Make a complex security check on the current time or user.
– Generate a single audit record.Incorrect
A statement trigger is fired once on behalf of the triggering statement, regardless of the number of rows in the table that the triggering statement affects, even if no rows are affected. For example, if a DELETE statement deletes several rows from a table, a statement-level DELETE trigger is fired only once. Statement triggers are useful if the code in the trigger action does not depend on the data provided by the triggering statement or the rows affected. For example, use a statement trigger to:
– Make a complex security check on the current time or user.
– Generate a single audit record. -
Question 30 of 30
30. Question
How does place restriction on to delete row from table?
Correct
RAISE_APPLICATION_ERROR is a built-in procedure in oracle which is used to display the user-defined error messages along with the error number whose range is in between -20000 and -20999. Whenever a message is displayed using RAISE_APPLICATION_ERROR, all previous transactions which are not committed within the PL/SQL Block are rolled back automatically (i.e. change due to INSERT, UPDATE, or DELETE statements). RAISE_APPLICATION_ERROR raises an exception but does not handle it.
Incorrect
RAISE_APPLICATION_ERROR is a built-in procedure in oracle which is used to display the user-defined error messages along with the error number whose range is in between -20000 and -20999. Whenever a message is displayed using RAISE_APPLICATION_ERROR, all previous transactions which are not committed within the PL/SQL Block are rolled back automatically (i.e. change due to INSERT, UPDATE, or DELETE statements). RAISE_APPLICATION_ERROR raises an exception but does not handle it.