Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 237

Examine the description of the TRANSACTIONS table:

Which two SQL statements execute successfully? (Choose two.)

    Correct Answer: A, E

    The SQL statements must use valid syntax for aliasing columns. Single quotes cannot be used for aliases, only double quotes or no quotes at all are acceptable. In addition, the keyword DATE should be enclosed in double quotes if used as an alias to avoid syntax errors, but it is not required if DATE is not used as an alias but as a data type. Thus, the first option executes successfully because it uses valid double quotes around aliases and correctly handles the keyword DATE as a data type. The fifth option also executes successfully as it uses no quotes around the aliases, maintaining correct syntax overall.

Discussion
Misi_OracleOptions: AD

A,D,E is correct. Tested. Feel free to try SELECT 'abc' AS "customer_id", Sysdate as "date", 10+100 Dues FROM DUAL; {ASS SELECT 'abc' AS 'customer_id', Sysdate as date, 10+100 'Dues' FROM DUAL; Fail because single quote for alias and not double quote on date. Alias cannot be in a single quote and date must be in a double quote as date is saved as a datatype SELECT 'abc' AS "customer_id", Sysdate as DATE, 10+100 "Dues" FROM DUAL; FAIL. No double quote for date SELECT 'abc' AS "customer_id", Sysdate as TRANS_DATE, 10+100 "Dues AMOUNT" FROM DUAL; PASS SELECT 'abc' CUSTID, Sysdate TRANS_DATE, 10+100 Dues FROM DUAL; PASS

JUMP56Options: AD

A, D, E are correct

ArslanAltafOptions: AD

ADE correct.

amizhOptions: DE

IT works 1) with as keyword , 2) with double quote 3) with out ANY quote but NOT WITH SINGLE QUOTE. Tested.

id10111110Options: AD

Based on the question, A, E and E are correct. Single quotes aren't allowed for column names, and DATE requires double quotes since DATE is a key word.