PL/SQL   «Prev  Next»

Varray Concepts - Quiz

Select one answer for each question. There are five questions, worth one point each; unanswered or invalid answers receive no credit.
1. Which statement best describes storage of a varray column in Oracle AI Database 26ai?
Please select the best answer.
  A. Every varray is stored entirely outside its parent row as a BLOB.
  B. Every varray is stored inline as a raw value, regardless of size.
  C. Oracle supports raw-value or LOB storage; the declared maximum size and storage settings influence the choice, and LOB data can be inline.
  D. Each varray element must occupy a separate row in a nested-table storage table.

2. Why can a nested-table column be a better fit when SQL frequently modifies individual collection elements?
Please select the best answer.
  A. It supports element-level SQL DML through TABLE(), whereas a stored varray is updated by replacing the collection value.
  B. Only varrays support element-level SQL DML through TABLE().
  C. Neither stored collection type supports SQL updates.
  D. Nested tables are always faster than varrays for every workload.

3. An application uses a small, bounded, ordered collection and normally retrieves and replaces it as a whole. Which collection is generally a good fit?
Please select the best answer.
  A. A nested table, because varrays cannot preserve element positions.
  B. Either type will always have identical storage and performance.
  C. Neither collection type supports whole-value replacement.
  D. A varray, subject to its declared element limit and the application's measured workload.

4. Given the initialized PL/SQL variable below, what are its COUNT and LIMIT values?
TYPE phone_array_type IS VARRAY(5) OF VARCHAR2(20);
v_phones phone_array_type := phone_array_type('555-0101', '555-0102');

Please select the best answer.
  A. COUNT = 5 and LIMIT = 2.
  B. COUNT = 2 and LIMIT = 5.
  C. COUNT = 2 and LIMIT = 2.
  D. COUNT = 0 and LIMIT = NULL.

5. Assume PHONE_ARRAY_TYPE is a varray type. What is the difference between these two PL/SQL declarations before any further assignment?
v_empty phone_array_type := phone_array_type();
v_null  phone_array_type;

Please select the best answer.
  A. Both variables are initialized empty collections and both have COUNT = 0.
  B. The empty constructor creates one NULL element.
  C. v_empty is an initialized zero-element collection; v_null is a NULL collection and must be initialized before EXTEND.
  D. v_null automatically becomes initialized when EXTEND is called.