1Z0-071 practice question 16 of 35
Examine the description of the transactions table: Which two SQL statements execute successfully?
Full set: 326 questionsOracle SQL has specific rules for column aliases. An alias can be provided with or without the AS keyword. If an alias contains special characters (like a hyphen), spaces, or is case-sensitive, it must be enclosed in double quotation marks ("). Unquoted aliases cannot contain spaces or special characters. Statement C uses valid unquoted aliases with the optional AS keyword omitted. Statement D correctly uses a double-quoted alias ("CUSTOMER-ID") for an identifier containing a hyphen and another ("DATE") for a keyword, which is a best practice.
A. While Oracle's parser may execute this, using a data type keyword (DATE) as an unquoted alias is poor practice and often considered incorrect in an exam context.
B. This statement fails because it uses single quotes (') for aliases. Single quotes are reserved for string literals, not for identifiers like column aliases.
E. This statement fails for two reasons: customer id is an unquoted identifier with a space, and CUSTOMER-ID is an unquoted alias with a hyphen.
1. Oracle Database SQL Language Reference, 19c. "SELECT Statements", selectlist syntax. The documentation specifies that a column alias (calias) can be an unquoted identifier or a string enclosed in double quotation marks.
2. Oracle Database SQL Language Reference, 19c. "Schema Object Naming Rules". Section on "Nonquoted Identifiers". This section details that nonquoted identifiers cannot contain special characters like hyphens.
3. Oracle Database SQL Language Reference, 19c. "Literals". This section clarifies that text literals (strings) are specified using single quotation marks.
Keep practicing
Take the free 1Z0-071 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 1Z0-071 practice questions
- Question 2Which three statements are true about single row functions?
- Question 3Which statement executes successfully?
- Question 4Which two are true about transactions in the Oracle Database?
- Question 6Which two are true about external tables that use the ORACLE _DATAPUMP access driver?
- Question 9Which statement will execute successfully?
- Question 10Examine this statement: CREATE TABTE orders (sarial_no NUMBER UNIQUE, order_id NUMBER PRI…
