English

What is the use of the INSTR() function in SQL? - Informatics Practices

Advertisements
Advertisements

Question

What is the use of the INSTR() function in SQL?

Options

  • To replace characters in a string

  • To find the length of a string

  • To find the position of a substring in a string

  • To extract characters from a string

MCQ
Advertisements

Solution

To find the position of a substring in a string

Explanation:

The INSTR() function in SQL returns the position (index) of the first occurrence of a specified substring within a given string.

SELECT INSTR('Database', 'a');

This returns 2, since the first 'a' appears at position 2.

shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×