Q19. View the exhibit and examine the structure of the STORES table.
STORES table
Name Null? Type
-—————- —– ————-
STORE_ID NUMBER
NAME VARCHAR2(100)
ADDRESS VARCHAR2(200)
CITY VARCHAR2(100)
COUNTRY VARCHAR2(100)
START_DATE DATE
END_DATE DATE
PROPERTY_PRICE NUMBER
You want to display the NAME of the store along with theADDRESS, START_DATE, PROPERTY_PRICE, and the projected property price, which is 115% of property price.
The stores displayed must have START_DATE in the range of 36 months starting from 01-Jan-2000 and above.
Which SQL statement would get the desired output?
A. SELECT name, concat (address| | ‘,’| |city| |’, ‘, country) AS full_address, start_date, property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN (start_date, ’01-JAN-2000′) <=36;
B. SELECT name, concat (address| | ‘,’| |city| |’, ‘, country) AS full_address, start_date, property_price, property_price*115/100
FROM stores
WHERE TO_NUMBER(start_date-TO_DATE(’01-JAN-2000′,’DD-MON-RRRR’)) <=36;
C. SELECT name, address||’,’||city||’,’||country AS full_address, start_date, property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN (start_date, TO_DATE(’01-JAN-2000′,’DD-MON-RRRR’)) <=36;
D. SELECT name, concat (address||’,’| |city| |’, ‘, country) AS full_address, start_date, property_price, property_price*115/100
FROM stores
WHERE MONTHS_BETWEEN (start_date, TO_DATE(’01-JAN-2000′,’DD-MON-RRRR’)) <=36;
Correct Answer:C
CONCAT will only allow 2 values to be concatenated.