nerdexam
Oracle

1Z0-061 · Question #50

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. Which two…

The correct answer is B. Option B C. Option C. 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…

Restricting and Sorting Data

Question

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. Which two queries would achieve the required result?

Exhibit

1Z0-061 question #50 exhibit

Options

  • AOption A
  • BOption B
  • COption C
  • DOption D

How the community answered

(50 responses)
  • A
    16% (8)
  • B
    76% (38)
  • D
    8% (4)

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. You can also sort by a column that is not in the SELECT list.

Topics

#NULLS LAST#ORDER BY#NULL sorting#credit limit

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice