What is the output of the following MySQL command? SELECT INSTR('MISSISSIPPI',…
2026
What is the output of the following MySQL command?
SELECT INSTR('MISSISSIPPI', 'S');
- A.
1
- B.
2
- C.
3
- D.
4
Attempted by 457 students.
Show answer & explanation
Correct answer: C
In MySQL, the function INSTR(string, substring) returns the position of the first occurrence of the substring in the string (starting index = 1).
For 'MISSISSIPPI':
M = 1
I = 2
S = 3 (first occurrence)So,
INSTR('MISSISSIPPI', 'S') = 3.