Skip to main contentSkip to solution

Which of the following are legitimate functions in SQL?

A. MOD(A, B)

B. LTRIM(string)

C. Day(date)

D. SUB(string, pos, n)

Solution

✅ Correct Option: 2

MOD(A, B) returns the remainder of A divided by B, LTRIM(string) removes leading spaces from a string, and DAY(date) returns the day of the month from a date. All three are standard SQL functions, so A, B and C are legitimate.


Options 1, 3 and 4: all of them include D, but SUB(string, pos, n) is not an SQL function. The real function is SUBSTR(string, pos, n), also written SUBSTRING or MID in some systems.

Keyboard Shortcuts

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