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');

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. 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.

Explore the full course: Up Lt Grade Assistant Teacher 2025