Skip to main contentSkip to solution

State the output of the following query:

SELECT MID('PYTON PROGRAMS',4,5);

Solution

✅ Correct Option: 2

MID(string, position, length) returns length characters starting from position, where counting starts at 1.

PYTON(space)PRO
123456789

Starting at position 4 and taking 5 characters gives O, N, space, P, R, which is ON PR.

SQL positions start at 1, not 0, so starting from 0 would wrongly give N PRO.

Keyboard Shortcuts

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