Skip to main contentSkip to solution

Which of the following functions are string functions?

(A) LENGTH()

(B) TRIM()

(C) MOD()

(D) LEFT()

Solution

✅ Correct Option: 1

LENGTH(), TRIM() and LEFT() work on text values, so they are string functions in SQL (MySQL).

LENGTH() returns the number of characters (or bytes) in a string, TRIM() removes leading and trailing spaces, and LEFT() returns a given number of characters from the start of a string.


Option 2, 3 and 4: MOD() is a numeric (math) function that returns the remainder of a division, e.g. MOD(10, 3) gives 1. It is not a string function.

Keyboard Shortcuts

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