OCP 1Z0 051 16

16. Evaluate the following query: 
SQL> SELECT promo_name ||  q'{'s start date was }'  || promo_begin_date                            
AS "Promotion Launches" 
FROM promotions; 
What would be the outcome of the above query? 
A. It produces an error because flower braces have been used. 
B. It produces an error because the data   types are not matching. 
C. It executes successfully and introduces an   's at the end of each promo_name in the output. 
D. It executes successfully and displays the literal " {'s start date was } " for each row in the output. 

考点:

q-quote

1) q-quote界定符可以是除了TAB,空格,回车外的任何单字节或多字节字符。

2) 除了单字节的的开始界定符是[,{,<,(,那么结束界定符必须是],},>,)  其他开始界定符与结束界定符必须一致
q-quote界定符的内字符串可示为单引号。而字符串的起止位置以界定符为准。

与第13题考点一样

SQL> SELECT promo_name || q'{'s start date was }' || promo_begin_date AS "Promotion Launches"
  2    FROM sh.promotions
  3    WHERE ROWNUM <= 2;
Promotion Launches
--------------------------------------------------------------
NO PROMOTION #'s start date was 01-1月 -99
newspaper promotion #16-108's start date was 23-12月-00
Executed in 0.016 seconds

Answer: C 

你可能感兴趣的:(OCP 1Z0 051 16)