Examine this partial statement:
SELECT ename, sal, comm FROM emp
Now examine this output:
Which ORDER BY clause will generate the displayed output?
Examine this partial statement:
SELECT ename, sal, comm FROM emp
Now examine this output:
Which ORDER BY clause will generate the displayed output?
The correct ORDER BY clause needed to generate the displayed output is the one that orders based on the commission (comm) in descending order while placing nulls last, followed by ordering based on the employee name (ename) to ensure a secondary order. The ordering shown in the output indicates that the rows are sorted first by the comm values in descending order with non-null values appearing first, and then alphabetically by ename. Therefore, the correct clause is 'ORDER BY comm DESC NULLS LAST, ename'.
D is not correct, because Turner is last in the table. A is correct answer
D also correct answer,, Tested and its giving expected output
NVL lets you replace null (returned as a blank) with a string in the results of a query. If expr1 is null, then NVL returns expr2. If expr1 is not null, then NVL returns expr1. Meaning that the output would be replaced by 0. The output still remains as null. https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/NVL.html
Tested on Oracle live sql. A is correct query for the output B comm nulls are at the top - wrong C Turmer, Allen, Ward, Martin at the bottom - wrong D Only Turner at the bottom - wrong
A for me