Which three SQL statements would execute successfully?

Here is the structure and data of the CUST_TRANS table: Exhibit: 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.)

Here is the structure and data of the CUST_TRANS table: Exhibit: 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.)

A.
SELECT transdate + ’10’ FROM cust_trans;

B.
SELECT custno + ‘A’ FROM cust_trans WHERE transamt > 2000;

C.
SELECT * FROM cust_trans WHERE transdate=’01-JANUARY-07′;

D.
SELECT * FROM cust_trans WHERE transdate = ’01-01-07′;

E.
SELECT transamt FROM cust_trans WHERE custno > ’11’;



Leave a Reply 2

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


candido dessanti

candido dessanti

A-D-E

jrporto

jrporto

SQL> select value from v$nls_parameters where parameter=’NLS_DATE_FORMAT’;

VALUE
——————————————————————————–
dd-mm-rr

A)
SQL> SELECT transdate + ’10’ FROM cust_trans;

TRANSDAT
——–
11-01-07
11-02-07
11-03-07
B)
SQL> SELECT custno + ‘A’ FROM cust_trans WHERE transamt > 2000;
SELECT custno + ‘A’ FROM cust_trans WHERE transamt > 2000
*
ERROR at line 1:
ORA-01722: invalid number

c)
SQL> SELECT * FROM cust_trans WHERE transdate=’01-JANUARY-07′;

CUSTNO TRANSDAT TRANSAMT
—— ——– ———-
11 01-01-07 1000

D)
SQL> SELECT * FROM cust_trans WHERE transdate = ’01-01-07′;

CUST_N TRANSDAT TRANSAMT
—— ——– ———-
11 01-01-07 1000

E)
SQL> SELECT transamt FROM cust_trans WHERE custno > ’11’;

TRANSAMT
———-
1000
1000

RPTA:
A,C,D,E