CBSE Class 12 Informatics Practices Question 53 of 81

MySQL Functions — Question 4

Back to all questions
4
Question

Question 2(iii)

Explain the MID() SQL function using suitable examples.

Answer

The MID() function returns a substring starting from the specified position. The syntax is:

MID(str, pos, len).

It returns a substring from str starting at position pos and containing len characters. For example,

SELECT MID('Quadratically', 5, 6);
Output
+---------------------------+
| MID('Quadratically', 5,6) |
+---------------------------+
| ratica                    |
+---------------------------+