QuestionQ105

VerifiedUsing Single-Row Functions to Customize Output

Examine the data in the ename and hiredate columns of the employees table:

Question Image

Question Image

You want to produce a list of user IDs as follows:

Question Image

You run the following query:

Question Image

What is the result?

Explanation

CONCAT accepts the two character expressions supplied. INITCAP capitalizes each name, SUBSTR(..., 1, 3) returns its first three characters, and REPLACE removes hyphens from the implicitly converted date value. The concatenated values therefore match the required user IDs.

Community Discussion

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