Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Assessment question on indexes
A certain OCA/OCP Introduction to Oracle9i SQL study guide contains the
following question.
Which of the following statements could use an index on the columns
PRODUCT_ID and WAREHOUSE_ID of the OE.INVENTORIES table?
A. select count(distinct warehouse_id) from oe.inventories;
B. select product_id, quantity_on_hand from oe.inventories where
warehouse_id = 100;
C. insert into oe.inventories values (5,100,32);
D. None of these statements could use the index
The following answer is provided:
Now I don't believe this is correct. I believe the correct answer is option D. The query in option A does not use a leading subset of the indexed columns (same as option B). I have run some tests that show the index is not used for option A or option B. I am running a 9.2 database on Windows.
Can anyone shed some light on this? What is the correct answer? Received on Wed Feb 09 2005 - 18:10:08 CST