Which of the following are valid functions to returns a substring of size 'n' starting from the specified position (pos) of the string?
A. INSTR(string, pos)
B. MID(string, pos, n)
C. SUBSTRING(string, pos, n)
D. SUBSTR(string, pos, n)
Which of the following are valid functions to returns a substring of size 'n' starting from the specified position (pos) of the string?
A. INSTR(string, pos)
B. MID(string, pos, n)
C. SUBSTRING(string, pos, n)
D. SUBSTR(string, pos, n)
Solution
✅ Correct Option: 4
MID(), SUBSTRING() and SUBSTR() in MySQL all return characters of a string starting at position pos, so B, C and D are valid.
For example, , and each return "form".
A: INSTR(string, substring) returns the position of the first occurrence of a substring inside a string. It does not extract text, and its second argument is a substring to search for, not a position.
Related questions:
2026: 26 May Shift 1
2026: 24 May Shift 1
2025: 3 June Shift 2
2026: 24 May Shift 1