Skip to main contentSkip to solution

Which of the following are string functions?

(A) LEFT(string, n)

(B) INSTR(string, substring)

(C) MID(string, pos, n)

(D) SUBSTRING(string, pos, n)

Solution

✅ Correct Option: 3

All four are standard MySQL string functions (CUET Informatics Practices, Database Query using SQL):

FunctionWhat it does
LEFT(string, n)Returns the first n characters of the string
INSTR(string, substring)Returns the position of the first occurrence of the substring in the string
MID(string, pos, n)Returns n characters starting from position pos
SUBSTRING(string, pos, n)Returns n characters starting from position pos

MID() and SUBSTRING() work identically in MySQL. MID() is a synonym of SUBSTRING().

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question