1Z0-007 · Question #175
Evaluate these two SQL statements: SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC; What is true about…
The correct answer is A. The two statements produce identical results. These two statements produce identical results, because it is possible even to use numbers to indicate the column position where Oracle should order the output from a statement. Incorrect Answers B: Second statement is correct and it will not return a syntax error. C: The…
Question
Evaluate these two SQL statements:
SELECT last_name, salary , hire_date FROM EMPLOYEES ORDER BY salary DESC; SELECT last_name, salary, hire_date FROM EMPLOYEES ORDER BY 2 DESC; What is true about them?
Options
- AThe two statements produce identical results.
- BThe second statement returns a syntax error.
- CThere is no need to specify DESC because the results are sorted in descending order by default.
- DThe two statements can be made to produce identical results by adding a column alias for the salary
How the community answered
(42 responses)- A71% (30)
- B17% (7)
- C10% (4)
- D2% (1)
Explanation
These two statements produce identical results, because it is possible even to use numbers to indicate the column position where Oracle should order the output from a statement. Incorrect Answers B: Second statement is correct and it will not return a syntax error. C: The results are sorted in ascending order by default. D: There is no corrections need to be made for the statements. They will return identical results.
Topics
Community Discussion
No community discussion yet for this question.