Examine the structure and data of the CUST_TRANS table:
Dates are stored in the default date format dd-mon-rr in the CUST_TRANS table.
Which SQL statements would execute successfully? (Choose three .)
A.
SELECT transdate + ’10’ FROM cust_trans;
B.
SELECT * FROM cust_trans WHERE transdate = ’01-01-07′;
C.
SELECT transamt FROM cust_trans WHERE custno > ’11’;
D.
SELECT * FROM cust_trans WHERE transdate=’01-JANUARY-07′;
E.
SELECT custno + ‘A’ FROM cust_trans WHERE transamt > 2000;
Why ans is D and why not B?
Ans : A , C will run succecssfully
There is no implicit conversion from ’01-01-07′ format.
Month has to be specified with abreviation JAN or full name JANUARY to be succesfully converted
A: 11-JAN-07 00:00:00, … (OK)
B: ORA-01843: not a valid month
C: 2000, 3000 (OK)
D: 11 01-JAN-07 00:00:00 1000 (OK)
E: ORA-01722: invalid number