Oracle
1Z0-061 · Question #86
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?
The correct answer is A. The two statements produce identical results. The two statement produce identical results as ORDER BY 2 will take the second column as
Restricting and Sorting Data
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
How the community answered
(26 responses)- A81% (21)
- B4% (1)
- C4% (1)
- D12% (3)
Explanation
The two statement produce identical results as ORDER BY 2 will take the second column as
Topics
#ORDER BY#column position#DESC#SELECT statement
Community Discussion
No community discussion yet for this question.