OCP 1Z0 051 77

来源:互联网 发布:什么是网络销售 编辑:程序博客网 时间:2024/06/06 03:00
77. In the CUSTOMERS table, the CUST_CITY column contains the value 'Paris' for the 
CUST_FIRST_NAME 'ABIGAIL'. 
Evaluate the following query: 
SQL> SELECT INITCAP(cust_first_name || ' ' ||
UPPER(SUBSTR(cust_city,-LENGTH(cust_city),2))) 
FROM customers 
WHERE cust_first_name = 'ABIGAIL'; 
What would be the outcome? 
A. Abigail PA 
B. Abigail Pa 
C. Abigail IS 
D. an error message 

INITCAP 每个单词首字母大写,其它字母小写
-LENGTH(cust_city) 反向定位全长,相当于 substr(cust_ciry,1,2)
SQL> SELECT cust_first_name,  2         cust_city,  3         initcap(cust_first_name || ' ' ||  4                 upper(substr(cust_city, -length(cust_city), 2)))  5    FROM sh.customers  6   WHERE cust_first_name = 'Abigail'  7     AND rownum <= 5;CUST_FIRST_NAME      CUST_CITY                      INITCAP(CUST_FIRST_NAME||''||U-------------------- ------------------------------ ------------------------------Abigail              Ede                            Abigail EdAbigail              Hoofddorp                      Abigail HoAbigail              Schimmert                      Abigail ScAbigail              Scheveningen                   Abigail ScAbigail              Joinville                      Abigail Jo5 rows selected

Answer: B 
0 0