COMPUTER APPLICATIONS
DATABASE MANAGEMENT SYSTEMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Ascending, descending
|
|
Asc, Desc
|
|
Desc, Asc
|
|
All of the above
|
Detailed explanation-1: -Expl:-To sort the salary from highest to lowest amount and display theemployee’s name alphabetically, one can use the “Desc and Asc” in the above-given Query.
Detailed explanation-2: -If you want to sort the data in descending order, you must explicitly specify it as shown below. ORDER BY name, salary DESC; The above query sorts only the column ‘salary’ in descending order and the column ‘name’ by ascending order.
Detailed explanation-3: -SELECT last name, job id, salary FROM employees WHERE job id IN (’IT PROG’, ‘SH CLERK’) AND salary NOT IN (4500, 10000, 15000);
Detailed explanation-4: -SELECT column-list|* FROM table-name ORDER BY ASC | DESC; SELECT * FROM Emp ORDER BY salary; SELECT * FROM Emp ORDER BY salary DESC;