1Z0-007 · Question #110
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 Incorrect answer: B there is no syntax error C result are sorted in ascending order by default D ORDER BY 2 will take the second column as
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
(58 responses)- A81% (47)
- B3% (2)
- C5% (3)
- D10% (6)
Explanation
the two statement produce identical results as ORDER BY 2 will take the second column as Incorrect answer: B there is no syntax error C result are sorted in ascending order by default D ORDER BY 2 will take the second column as
Topics
Community Discussion
No community discussion yet for this question.