Oracle Database 11g: SQL Fundamentals I — Question 12
Here is the structure and data of the CUST_TRANS table:
Exhibit:
CUST_TRANS -
Name Null? Type
-------------- ----------------- ------------------
CUSTNO NOT NULL CHAR (2)
TRANSDATE DATE
TRANSAMT NUMBER (6, 2)
CUSTNO TRANSDATE TRANSAMT
------------- ----------------------- -----------------------
11 01-JAN-07 1000
22 01-FEB-07 2000
33 01-MAR-07 3000
Dates are stored in the default date format dd-mm-rr in the CUST_TRANS table.
Which three SQL statements would execute successfully? (Choose three.)
Answer options
- 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;
Correct answer: A, C, D
Explanation
The correct answers A, C, and D will execute successfully. A correctly adds a number to a date, C compares the custno values properly, and D matches the transdate in a valid format. Options B and E are incorrect because B uses the wrong date format and E tries to concatenate a string to a number, which is not permitted.