Skip to main contentSkip to solution

What is output of the following SQL statement?

LENGTH(MID("COMPUTER",3,5));

Solution

✅ Correct Option: 2

MID(str, pos, n) returns n characters starting at position pos, so MID("COMPUTER",3,5) starts at the 3rd character (M) and takes 5 characters, giving "MPUTE".

LENGTH("MPUTE") counts the characters, which is 5.


Option 3: 8 is the length of the whole string "COMPUTER", but MID extracts only part of it first.

Option 1: 3 is the starting position, not the length of the result.

Keyboard Shortcuts

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