Which statement would accomplish this requirement?

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?

You need to produce a report where each customer’s credit limit has been incremented by $1000. In the output, t he 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?

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;



Leave a Reply 9

Your email address will not be published. Required fields are marked *


Oscar Copado Silva

Oscar Copado Silva

Does anybody could explain me why option A) is invalid ?

Morven

Morven

Because alias without double quotation will automatically changed to uppercase, so in the output, the first column heading will be NAME, no Name as you expected.

networkmanagers

networkmanagers

great .

Ritam Tiwari

Ritam Tiwari

oh wow…thanks morven../.

Shweta Singh

Shweta Singh

B should be the right answer,b’coz if we use SELECT cust_last_name AS Name then in this case no need for double quotes.
SELECT cust_last_name “Name” : Here we can use double quotes.

Ananta Pilaka

Ananta Pilaka

B is not correct.

the second column name has spaces so it needs to be put in []

Mohit

Mohit

why D is incorrect?

Alvin2201

Alvin2201

D is incorrect because an alias must be a literal, it can’t be the result of a function.