Multiple choice technology databases

In For Loop syntax to go in reverse order

  1. begin For 1 in reverse 1..3 loop dbms_output.put_line(‘I is’ ||i); End loop; End; /

  2. begin For 1 in 1..3 reverse loop dbms_output.put_line(‘I is’ ||i); End loop; End; /

  3. begin For 1 in 3..1 loop dbms_output.put_line(‘I is’ ||i); End loop; End; /

  4. begin For 1 in 3..1 reverse loop dbms_output.put_line(‘I is’ ||i); End loop; End; /

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

The correct syntax for a reverse FOR loop is 'FOR variable IN REVERSE lower..upper LOOP'. Option A shows the correct structure with REVERSE positioned correctly between the loop variable and the range. Options B and D place REVERSE incorrectly, and C lacks it entirely.