What would be the outcome?

In the customers table, the CUST_CITY column contains the value ‘Paris’ for the
CUST_FIRST_NAME ‘Abigail’.
Evaluate the following query:

What would be the outcome?

In the customers table, the CUST_CITY column contains the value ‘Paris’ for the
CUST_FIRST_NAME ‘Abigail’.
Evaluate the following query:

What would be the outcome?

A.
Abigail PA

B.
Abigail Pa

C.
Abigail IS

D.
An error message

Explanation:



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Marcelo

Marcelo

The catch this issue is to use UPPER together with INITCAP function, however INITCAP preceding UPPER.

Lima Eduardo

Lima Eduardo

select initcap(‘Abigail’||’ ‘||upper(substr(‘Paris’,-length(‘Paris’),2)))as result from dual

RESULT
==========
Abigail Pa

Read 1 rows

Eduardo Lima

Eduardo Lima

select initcap(‘Abigail’||’ ‘||upper(substr(‘Paris’,-length(‘Paris’),2)))as result from dual

RESULT
==========
Abigail Pa

Read 1 rows

Sayed

Sayed

The INITCAP() function creates the whole expression first letter capital although the UPPER() initially made Paris to PA.

So B is right

shine

shine

Why is option C) not the answer?
Since,its ‘-Length’, it should start from the end of the word ‘Paris’ and take the last 2 alphabets, i.e. ‘is’

karan

karan

-Length(‘Paris”) = -5 = 5th character from last.
(‘Paris’,-5,2) = P is the 5th character from last character and 2 char to be selected = Pa

Amit

Amit

Hi Guys,

I’m doing preparation for Oracle Database 12c: sql fundamentals, so i have need some dump copies for it. if you guys have any idea about Oracle Databse 12c: sql fundamentals then please send me at [email protected] ..

Thanks,
Amit