OCP-1Z0-051-題目解析-第12題

來源:互聯網
上載者:User

12. You need to produce a report where each customer's credit limit has been incremented by $1000. In
the output, the customer's last name should have the heading Name and the incremented credit limit
should be labeled New Credit Limit. The column headings should have only the first letter of each word in uppercase. 
Which statement would accomplish this requirement?

(題意:你需要製作一個報表,該表報中顧客的credit limit需要加1000,顧客名稱欄位的標題名稱為Name,新credit limit的標題名稱為 New Credit Limit,這三個單詞要首字母大寫。問下面的哪條語句符合上面的要求?)
A.
SELECT cust_last_name Name, cust_credit_limit + 1000 
"New Credit Limit" 
FROM customers;
B.
SELECT cust_last_name AS Name, cust_credit_limit + 1000 
AS New Credit Limit 
FROM customers;
C.
SELECT cust_last_name AS "Name", cust_credit_limit + 1000 
AS "New Credit Limit" 
FROM customers;
D.
SELECT INITCAP(cust_last_name) "Name", cust_credit_limit + 1000 
INITCAP("NEW CREDIT LIMIT") 
FROM customers;


Answer: B

題目解析:

這道題是關於欄位標題是否加雙引號的問題,關於雙引號的使用規則如下:

1.如果欄位名稱是多個單片語成,中間有空格,如New Credit Limit,則必須加雙引號,否則會報錯。
2.如果標題名稱是一個單詞或多個連續的單詞,如果不加雙引號,則輸出的格式是完全大寫的,如選項A,就會輸出NAME。
   如果加雙引號則會原樣輸出,如選項C會輸出 Name
綜上所述,所以這道題的正確答案是C
D選項中的initcap函數不可用於欄位名稱,是語法錯誤。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.