QuestionQ111

VerifiedUsing Conversion Functions and Conditional Expressions

Examine the data in the CUST_NAME column of the customers table.

Question Image

You must display customers’ second names when the second name begins with "Mc" or "MC."

Which query produces the required output?

Question Image

Explanation

INITCAP converts the surname to a form with its first letter uppercase and remaining letters lowercase. Therefore, surnames beginning with either Mc or MC normalize to values starting with Mc; LIKE 'Mc%' matches the required prefix while retaining the entire extracted second name. INITCAP — Oracle Database SQL Language Reference

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!