Skip to main contentSkip to solution

Which of the following are text functions?

(A) MID()

(B) INSTR()

(C) SUBSTR()

(D) LENGTH()

Solution

✅ Correct Option: 3

All four work on strings, so all four are text (string) functions in SQL.

FunctionWhat it does
MID()Returns a part of a string from a given position
INSTR()Returns the position of the first occurrence of a substring
SUBSTR()Returns a part of a string (works like MID())
LENGTH()Returns the length of a string

INSTR() and LENGTH() return numbers, but their input is a string, so they still count as text functions, not numeric ones.

MID() and SUBSTR() do the same job, so both are in the list.

Keyboard Shortcuts

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