Querying Object Tables - Quiz Explanation

The answers you selected are indicated below, along with text that explains the correct answers.

 
1. What is the correlation argument for the DEREF operator?
Please select the best answer.
  A. Like VALUE and REF, DEREF expects a table name alias as its correlation argument.
  B. The correlation argument is the object name.
  C. The correlation argument is the object type.
  D. The correlation argument is the REF (reference) to the object.
  Answer D is correct.
DEREF is a dereferencing operator and returns the object when a reference is passed to it. Hence, answer D is correct. Answer A is incorrect because DEREF expects a REF as the correlation argument. Answer B is incorrect because the object name is not a valid argument. Answer C is incorrect because the object type is also an invalid argument.

2. What is the difference between REF and DEREF operators?
Please select the best answer.
  A. REF returns a reference to the object and DEREF returns the object itself.
  B. REF returns the object and DEREF returns the REF of the object after dereferencing it.
  C. There is no difference.
  D. REF returns the value of the object and DEREF returns the object itself.
  Correct answer is A.
A REF operator returns the OID of the referencing object and DEREF returns the object itself after accepting the REF as a correlation argument. Hence, answer A is correct. Answer B is incorrect because REF does not return the object. Answer C is incorrect because REF and DEREF are completely opposite operators. Answer D is incorrect because REF does not return the value of an object.

3. To view the data of the object that is referenced within another object, which operator--REF, DEREF, or VALUE--should you use in a query?
Please select the best answer.
  A. Use the REF operator because it returns the reference to the object within an object table.
  B. Use the DEREF operator because the reference must be dereferenced before displaying the data of the referenced object.
  C. Use the VALUE operator because it returns the complete object.
  D. Use a combination of the REF and DEREF operators to return the data from the referenced object.
  Answer B is correct .
Answer B is correct because the DEREF operator dereferences the reference to the object table and returns data from the associated object. Answer A is incorrect because the REF operator returns the reference to the object, which is a 128-character OID. Answer C is incorrect because the VALUE operator returns the complete object, that is, all the columns and attributes (if applicable) of the object table, but no data from the associated reference. Answer D is incorrect because a combination of the REF and DEREF operators is not required to accomplish this task.



Oracle SQL