Skip to main contentSkip to solution

Find the output of the following query:

SELECT LEFT(RIGHT(UCASE('computer science'),7),3);

Solution

✅ Correct Option: 2

The functions are evaluated from the inside out.

UCASE(’computer science’)\text{UCASE('computer science')} gives COMPUTER SCIENCE.

RIGHT(..., 7)\text{RIGHT(..., 7)} takes the last 7 characters, which gives SCIENCE.

LEFT(..., 3)\text{LEFT(..., 3)} takes the first 3 characters of SCIENCE, which gives SCI.


Option 3: NCE is the last 3 characters of SCIENCE, which is what RIGHT would give, not LEFT.

Option 4: UCASE converts the text to upper case, so the output cannot be lower case.

Keyboard Shortcuts

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