Querying Object Tables - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. What is the difference between varrays and nested tables?
Please select the best answer.
  A. A varray is an object. A nested table is a relational table.
  B. A varray is an array that can be defined only within PL/SQL. A nested table is a persistent object within the database.
  C. A varray has a predefined set of elements. A nested table can have any number of elements.
  D. A varray can have any number of elements. A nested table has a predefined set of elements.
  Answer C is correct. A varray has predefined set of elements, which is not the case with nested tables.
Hence, answer C is correct, Answer A is incorrect because both varrays and nested tables are user-defined objects. Answer B is incorrect because varrays and nested tables are indeed persistent objects within the database. Answer D is incorrect because a varray (not a nested table) has a predefined set of elements and can be scarce.

2. l If an object table has an object type within another object type, how will you query the object table?
Please select the best answer.
  A. Use a simple SELECT statement.
  B. Use dot notation to drill down to the attribute of the object type.
  C. You cannot query such an object table.
  D. Use the REF and VALUE operators.
  Answer B is correct.
If an object table has object types within object types, you can query such a table by using prefixes and dot notation, so Answer B is correct.
Answer A is ambiguous, so it is incorrect. Answer C is incorrect because you can indeed query such object tables. Answer D is incorrectbecause the REF and VALUE operators are used when an object is referenced within another object.

3. l Can you use enumeration types to index collections within Oracle8i?
Please select the best answer.
  A. No, because collections can have only one dimension and you must use integers to index them.
  B. Yes, because collections can have multiple dimensions.
  C. No, because although collections can have multiple dimensions, Oracle8i does not support indexing them by enumeration types.
  D. Yes, because indexing collections within Oracle8i is similar to indexing arrays in Pascal and Ada.
  Answer A is correct.
Within Oracle8i, collections can have only one dimension.
As a result, you can index them by integers only, so answer A is correct.
Answer B is incorrect because, unlike arrays in Pascal and Ada, collections cannot have multiple dimensions. Answer C is incorrect because collections cannot have multiple dimensions. Answer D is incorrect because arrays in programming languages such as Pascal and Ada can havemultiple dimensions. However, collections within Oracle8i cannot. Therefore, indexing collections within Oracle8i is not similar to indexing arrays in Pascal and Ada.