PL SQL Practice Test 12
Where can a Varray be stored?
- At package or at the schema level.
- PL/SQL block or at the schema level.
- PL/SQL block or at the package level.
- PL/SQL block or package or at the schema level
Ans : 4
Which of the following collections can be stored in the database?
- Associative array and Varray
- Varray and nested table
- Associative array and nested table
- Associative array, Varray and nested table
Ans : 2
Which of the following collections have an initialized status as empty?
- Associative array
- Varray
- Nested table
- Records
Ans : 1
What does DELETE (m,n) do when applied on a collection variable?
- Deletes the mth and nth element of the collection.
- Deletes element before mth place and after nth place
- Deletes elements in the range of m to n Throws an error.
- This form is not supported for DELETE.
Ans : 3
Which of the following is not a characteristics of EXTEND method?
- EXTEND operates on the internal size of a collection.
- If DELETE deletes an element but keeps for it, then EXTEND considers the element exist.
- EXTEND adds elements to the beginning of a collection
- There are three forms of EXTEND procedure
Ans : 3
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
What are the various forms of EXISTS method?
- EXISTS only
- EXISTS ,EXISTS(m.n) and EXISTS(n)
- EXISTS(n) only
- EXISTS and EXISTS(n)
Ans : 4
What can be present in the body of a FORALL statement?
- One or more DML statements
- A single DML statement
- A single SELECT or DML statement
- One or more SELECT statement
Ans : 2
How many times does a PL/SQL engine access the to fetch 100 rows using BULK SQL?
- Twice
- Once
- Hundred times
- One to 10 times depending on the batch size
Ans : 2
Where can a BULK COLLECT clause be used?
- SELECT INTO statement and FETCH statement
- RETURNING INTO clause and SELECT INTO statement
- FORALL statement and SELECT INTO statement
- SELECT INTO statement, RETURNING INTO statement and FETCH statement
Ans : 4
Which of the following in incorrect regarding the FORALL statement?
- FORALL sends DML statements from PL/SQL to SQL in batches rather than one at a time.
- FORALL tells the PL/SQL runtime engine to bulk bind into the SQL statement
- FORALL statement is a FOR LOOP
- FORALL statement contains an iteration scheme
Ans : 3
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
Which is the correct syntax to use BULK COLLECT with SELECT INTO statement?
- SELECT column_names BULK COLLECT INTO collection_type FROM table_name
- SELECT column_names INTO BULK COLLECT collection_type FROM table_name
- SELECT BULK column_names COLLECT INTO collection_type FROM table_name
- SELECT BULK COLLECT column_names INTO collection_type FROM table_name
Ans : 1
Which of the following type of variables does all BULK operations in PL/SQL fetch data?
- Scalar
- Collection
- Records
- User defined types
Ans : 2
Which of the following code correctly create a record named book with two fields?
- TYPE book IS RECORD (title varchar(50), author varchar(50));
- RECORD book (title varchar(50), author varchar(50) );
- CREATE RECORD book (title varchar(50), author varchar(50));
- CREATE TYPE book(title varchar(50), author varchar(50));
Ans : 1
Which of the following is true about PL/SQL index-by tables?
- It 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.
- All of the above.
Ans : 4
Which of the following is true about the PL/SQL data structure VARRAY?
- It also has a maximum size that cannot be changed.
- A VARRAY type is created with the CREATE VARRAY statement, at the schema level.
- Maximum size of a VARRAY can be changed using the ALTER TYPE statement.
- Maximum size of a VARRAY can be changed using the ALTER VARRAY statement.
Ans : 3
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
Which of the following is not among the types of PL/SQL records?
- Table-based
- View-based
- Cursor-based records
- User-defined records
Ans : 2
The collection method LAST
- Returns the last (largest) index numbers in a collection that uses integer
- Returns the number of elements that a collection currently contains.
- Checks the Maximum Size of a Collection.
- None of the above.
Ans : 1
Which of the following is not true about PL/SQL nested tables?
- Nested table is similar to declaration of an index-by table along with INDEX BY clause.
- A nested table can be stored in a database column.
- Elements of a nested table could be a %ROWTYPE of any database table.
- Elements of a nested table could also be %TYPE of any database table field.
Ans : 1
Nested tables can be sparse
- Yes
- No
- Depends upon
- None
Ans : 1
Associative arrays also known as index-by tables.
- True
- False
- Depends upon
- None
Ans : 1
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
Which is a group of related data items stored in fields, its own name and datatype?
- Record
- A Collection
- Both A & B
- None of the above
Ans : 1
Which collection exception is raised when nonexistent element of an associative array?
- NO_DATA_FOUND
- COLLECTION_IS_NULL
- SUBSCRIPT_BEYOND_COUNT
- SUBSCRIPT_OUTSIDE_LIMIT
Ans : 1
Which of the following cannot be used with associative arrays?
- EXTEND
- TRIM
- Both A & B
- None of the above
Ans : 3
Arrays in other languages become varrays in PL/SQL.
- True
- False
- Depends upon
- None
Ans : 1
Collection is an ordered group of elements, all of the same type.
- True
- False
- Depends upon
- None
Ans : 1
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
A collection is a function or procedure that operates on it using dot notation.
- True
- False
- Depends upon
- None
Ans : 1
Varrays are a good choice when –
- The number of elements is known in advance.
- The elements are usually all accessed in sequence.
- Both A & B
- None of the above
Ans : 3
The collection method COUNT returns…?
- Returns the last (largest) index numbers in a collection that uses integer subscripts.
- Returns the number of elements that a collection currently contains.
- Checks the Maximum Size of a Collection.
- None of the above.
Ans : 2
Attend Free Demo and Learn SQL SERVER ONLINE TRAINING by Real-Time Expert
Read More PL/SQL Objective Questions and Answers