State the correct output of the following command.
SELECT SUBSTR('NTA CUET 2025',3,-2);
State the correct output of the following command.
SELECT SUBSTR('NTA CUET 2025',3,-2);
Solution
✅ Correct Option: 3
The syntax is . It returns characters starting from position , and the count always runs forward.
Here , which is less than 1, so zero characters are returned. The result is an empty string, so the query displays no output.
Options 1 and 2: a negative length does not make the function read backwards from position 3.
Option 4: a negative position counts from the end of the string, so would give 25. Here the negative value is the length, not the position.
Related questions:
2025: 27 May Shift 2
2025: 16 May Shift 1
2026: 29 May Shift 2
2026: 31 May Shift 1