exam questions

Exam 1z0-061 All Questions

View all questions & answers for the 1z0-061 exam

Exam 1z0-061 topic 2 question 6 discussion

Actual exam question from Oracle's 1z0-061
Question #: 6
Topic #: 2
[All 1z0-061 Questions]

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?

  • A. The two statements produce identical results.
  • B. The second statement returns a syntax error.
  • C. There is no need to specify DESC because the results are sorted in descending order by default.
  • D. The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement. A
Show Suggested Answer Hide Answer
Suggested Answer: Explanation 🗳️
the two statement produce identical results as ORDER BY 2 will take the second column as sorting column.
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 sorting column.
Refer: Introduction to Oracle9i: SQL, Oracle University Study Guide, 2-22

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Blob44
2 years, 1 month ago
Selected Answer: A
column aliases and/or number as order in the select for the col are allowed in order by clause. default is ASC so DESC is needed
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago