Winch two queries would achieve the required result?

You need to generate a list of all customer last names with their credit limits from the
CUSTOMERS table. Those customers who do not have a credit limit should appear last in the list.
Winch two queries would achieve the required result? (Choose two.)

You need to generate a list of all customer last names with their credit limits from the
CUSTOMERS table. Those customers who do not have a credit limit should appear last in the list.
Winch two queries would achieve the required result? (Choose two.)

A.
SELECT cust_last_name. cust_credit_limit FROM customers
ORDER BY cust_credit_limit DESC:

B.
SELECT cust_last_name. cust_credit_limit FROM customers
ORDER BY cust_credit_limit:

C.
SELECT cust_last_name. cust_credit_limit FROM customers
ORDER BY cust_credit_limit NULLS LAST:

D.
SELECT cust_last_name. cust_credit_limit FROM customers
ORDER BY cust_last_name. cust_credit_limit NULLS LAST:

Explanation:
If the ORDER BY clause is not used, the sort order is undefined, and the Oracle server may not
fetch rows in the same order for the same query twice. Use the ORDER BY clause to display the
rows in a specific order.
Note: Use the keywords NULLS FIRST or NULLS LAST to specify whether returned rows
containing null values should appear first or last in the ordering sequence. ANSWER C
Sorting

The default sort order is ascending:
Numeric values are displayed with the lowest values first (for example, 1 to 999).
Date values are displayed with the earliest value first (for example, 01-JAN-92 before 01-JAN-95).
Character values are displayed in the alphabetical order (for example, A first and Z last).
Null values are displayed last for ascending sequences and first for descending sequences.
– ANSWER B
You can also sort by a column that is not in the SELECT list.



Leave a Reply 5

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


Dipak Upwanshi

Dipak Upwanshi

How option B can be correct?

Sagar

Sagar

Option B is correct as in ascending order sorting, null values are placed at last.

Jenny

Jenny

Because null values are displayed last for ascending sequences

fatima

fatima

A and C is the correct answer , C cause the default order is ascending and the null appear first for first so we used null last
for A the descending order display the null last

priest

priest

wrong fatima!!! B and C tested