What is true about them?

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?

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 second statement returns a syntax error.

B.
The two statements produce identical results.

C.
The two statements can be made to produce identical results by adding a column alias for the
salary column in the second SQL statement.

D.
There is no need to specify DESC because the results are sorted in descending order by
default.

Explanation:

: the two statement produce identical results as ORDER BY 2 will take the second column as
sorting column.
Refer : Introduction to Oracle9i : SQL, Oracle University Study Guide, 2-22



Leave a Reply 0

Your email address will not be published. Required fields are marked *