Which of the following are legitimate functions in SQL?
A. MOD(A, B)
B. LTRIM(string)
C. Day(date)
D. SUB(string, pos, n)
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.
Related questions:
2025: 14 May Shift 1
2025: 16 May Shift 1
2026: 13 May Shift 2
2025: 30 May Shift 2
2026: 26 May Shift 1