Multiple choice technology programming languages

The primary key on table EMP is the EMPNO column. Which of the following statements will not use the associated index on EMPNO?

  1. select * from EMP where nvl(EMPNO, '00000') = '59384';

  2. select * from EMP where EMPNO = '59384';

  3. select EMPNO, LASTNAME from EMP where EMPNO = '59384';

  4. select 1 from EMP where EMPNO = '59834';

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The correct answer is A. When a column is wrapped in a function like NVL(EMPNO, '00000'), the database cannot use the index on EMPNO directly because the indexed value is transformed. This is a classic example of a function preventing index usage. Options B, C, and D all use EMPNO = 'value' with no function wrapping, so they would use the index (note: C and D have typos in values but would still use indexes).