Database Fundamentals — Question 66
You have a table named Product that contains one million rows.
You need to search for product information in the Product table by using the product's unique ID.
What will make this type of search more efficient?
Answer options
- A. A cursor
- B. A subquery
- C. A trigger
- D. An index
Correct answer: D
Explanation
Creating an index on the unique ID of the product significantly speeds up search operations because it allows the database to quickly locate the relevant rows. In contrast, a cursor is used for row-by-row processing, a subquery may not optimize searches on large datasets, and a trigger is for automatically executing actions in response to certain events in the database, which does not improve search efficiency.