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.