Which LIKE pattern matches only strings that are exactly four characters long and end in ‘k’?
Correct answer C. '___k'
Explanation
In LIKE, each underscore matches exactly one character, while % matches any sequence of zero or more characters. Three underscores followed by k therefore match exactly four-character strings ending in k, such as 'desk' or 'book'. '%k' and '%%%k' match any length ending in k, because repeated % signs still mean any sequence. '_k%' requires k in the second position.
Answer checked How we write and check questions
Discussion