State the output of the following query.
SELECT UCASE(LOWER(LEFT('INFORMATICS',3)));
State the output of the following query.
SELECT UCASE(LOWER(LEFT('INFORMATICS',3)));
Solution
✅ Correct Option: 1
Functions are evaluated from the innermost outward.
LEFT('INFORMATICS',3) takes the first 3 characters, giving 'INF'. LOWER('INF') converts it to 'inf'. UCASE('inf') converts it back to uppercase, giving INF.
Option 2: 'inf' is the result after LOWER only; UCASE then changes it back to uppercase.
Options 3 and 4: these come from taking the last 3 characters, which is what RIGHT() does, not LEFT().
Related questions:
2025: 22 May Shift 1
2025: 27 May Shift 2