Which statement produces this output?

The CUSTOMERS table has these columns:

CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
CUSTOMER_ADDRESS VARCHAR2(150)
CUSTOMER_PHONE VARCHAR2(20)
You need to produce output that states “Dear Customer customer_name, “.
The customer_name data values come from the CUSTOMER_NAME column in the CUSTOMERS
table.
Which statement produces this output?

The CUSTOMERS table has these columns:

CUSTOMER_ID NUMBER(4) NOT NULL
CUSTOMER_NAME VARCHAR2(100) NOT NULL
CUSTOMER_ADDRESS VARCHAR2(150)
CUSTOMER_PHONE VARCHAR2(20)
You need to produce output that states “Dear Customer customer_name, “.
The customer_name data values come from the CUSTOMER_NAME column in the CUSTOMERS
table.
Which statement produces this output?

A.
SELECT dear customer, customer_name, FROM customers;

B.
SELECT “Dear Customer”, customer_name || ‘,’ FROM customers;

C.
SELECT ‘Dear Customer ‘ || customer_name ‘,’ FROM customers;

D.
SELECT ‘Dear Customer ‘ || customer_name || ‘,’ FROM customers;

E.
SELECT “Dear Customer ” || customer_name || “,” FROM customers;

F.
SELECT ‘Dear Customer ‘ || customer_name || ‘,’ || FROM customers;

Explanation:
Concatenation operator to create a resultant column that is a character expression.
Incorrect answer:
Ano such dear customer column
Binvalid syntax
Cinvalid syntax
Einvalid syntax
Finvalid syntax
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 1-18



Leave a Reply 5

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


Jason

Jason

is there any differece between D and F?

Jason

Jason

shit i got it;

Bina

Bina

Jason, the difference is double “” and ” coat.

Achin

Achin

I DIDNT FIND ANY DIFFERENCE BETWEEN d AND f.

Sagar

Sagar

In option F, there is one extra concatenation operator (||) in the end just before the FROM clause. 😉