Which three SQL statements would execute successfully?

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
three SQL statements would execute successfully?

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
three SQL statements would execute successfully?

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;



Leave a Reply 5

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


venus

venus

Correct answer : A, D, E

C : Error : Invalid Identifier

Salomao Costa

Salomao Costa

Tested: A, B, D
C is wrong. “11” invalid indentifier ORA-00904. Its CHAR(2). Valid only like ’11’ or 11

The Tuk

The Tuk

SQL> desc cust_trans;
Name Null? Type
—————————————– ——– —————————-
CUSTNO NOT NULL CHAR(2)
TRANSDATE DATE
TRANSAMT NUMBER(6,2)

SQL>
SQL> select TRANSAMT from cust_trans where CUSTNO > “11” ;
select TRANSAMT from cust_trans where CUSTNO > “11”
*
ERROR at line 1:
ORA-00904: “11”: invalid identifier

SQL>