Skip to main contentSkip to solution

What will the following query retrieve?

SELECT MID(phone, 3, 4) from customer where cust_address like '%Rohini%';

Solution

✅ Correct Option: 1

MID(string, start, length) returns length characters beginning at position start. So MID(phone, 3, 4) gives 4 characters starting from position 3 of the phone column.

In LIKE '%Rohini%', the % on both sides matches any characters, so the condition selects customers whose address contains "Rohini" anywhere in it.


Option 2: swaps the start and length arguments, since 3 is the start and 4 is the length.

Options 3 and 4: "starts with" would need 'Rohini%', and "ends with" would need '%Rohini'.

Keyboard Shortcuts

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