码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-06-27 15:53:14      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:style   color   com   使用   strong   问题   

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函数不可用于字段名称,是语法错误。

OCP-1Z0-051-题目解析-第12题,布布扣,bubuko.com

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

标签:style   color   com   使用   strong   问题   

原文地址:http://www.cnblogs.com/wjx515/p/3810232.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!