OCP-1Z0-051-Question Analysis-12th question

Source: Internet
Author: 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 shoshould have the heading Name and the incremented credit limit
Shocould be labeled New Credit Limit. The column headings shocould have only the first letter of each word in uppercase.
Which statement wocould accomplish this requirement?

(Question: You need to make a report. In this report, the customer's credit limit needs to be added to 1000. The title of the customer Name field is Name, and the title of the New credit limit is New Credit Limit, the three words must be capitalized. Which of the following statements meets the preceding requirements ?)
A.
SELECT cust_last_name Name, cust_credit_limit + 1000
"New Credit Limit"
FROM MERs MERS;
B.
SELECT cust_last_name AS Name, cust_credit_limit + 1000
AS New Credit Limit
FROM MERs MERS;
C.
SELECT cust_last_name AS "Name", cust_credit_limit + 1000
AS "New Credit Limit"
FROM MERs MERS;
D.
Select initcap (cust_last_name) "Name", cust_credit_limit + 1000
INITCAP ("new credit limit ")
FROM MERs MERS;


Answer: B

Question Analysis:

This question is about whether the field title is enclosed by double quotation marks. The rules for using double quotation marks are as follows:

1. If the field name is composed of multiple words with spaces in the middle, such as New Credit Limit, double quotation marks must be added; otherwise, an error is reported.
2. If the title NAME is A word or multiple consecutive words without double quotation marks, the output format is in uppercase. For example, if option A is used, the NAME is output.
If double quotation marks are added, the output is as is. For example, option C outputs the Name.
To sum up, the correct answer to this question is C.
The initcap function in option D cannot be used for field names, which is a syntax error.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.