Oracle Database 12c: SQL Fundamentals — Question 43
Examine the structure and data of the CUSTJTRANS table:
CUSTJRANS -
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-mon-rr in the CUSTJTRANS table. Which three SQL statements would execute successfully? (Choose three.)
Answer options
- A. SELECT transdate + '10' FROM custjrans;
- B. SELECT * FROM custjrans WHERE transdate = '01-01-07':
- C. SELECT transamt FROM custjrans WHERE custno > '11':
- D. SELECT * FROM custjrans WHERE transdate='01-JANUARY-07':
- E. SELECT custno - 'A' FROM custjrans WHERE transamt > 2000:
Correct answer: A, C, D
Explanation
The correct answers are A, C, and D. Option A executes successfully because it adds a number to a date, which is valid. Option C works as it correctly compares the character values of custno. Option D is valid as the date is in a recognized format. However, option B has a syntax error due to the colon, and option E fails because it attempts to subtract a character from a number, which is not permitted.