Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Oracle Exam 1Z0-071 Topic 8 Question 108 Discussion

Actual exam question for Oracle's 1Z0-071 exam
Question #: 108
Topic #: 8
[All 1Z0-071 Questions]

Examine this statement:

Which two statements are true?

Show Suggested Answer Hide Answer
Suggested Answer: C, E

D . All remaining employee names will appear in descending order F. The names of employees with maximum salary will appear first in descending order

Comprehensive and Detailed Explanation WITH all Reference:

Analyzing the given SQL query:

ORDER BY CASE WHEN salary = (SELECT max(salary) FROM employees) THEN 'A' ELSE last_name END, last_name DESC;

Here's what happens in the query:

The CASE statement checks if the employee's salary is equal to the maximum salary in the table.

If an employee has the maximum salary, they are assigned a constant value 'A', else their last_name is used for sorting.

Since 'A' comes before any possible last name value in ascending order, all employees with the maximum salary will be listed first.

After the CASE expression, the query specifies last_name DESC. This means that within each group sorted by the CASE expression, the names will be sorted in descending order.

Therefore, the employees with the maximum salary will appear first, and within that group, if there is more than one employee with the same maximum salary, they will be sorted in descending order by last name (F). Then, all remaining employee names will appear in descending order (D).


Oracle Documentation on CASE Expressions: CASE Expressions

Oracle Documentation on Sorting Query Results: Sorting Query Results

Contribute your Thoughts:

Tess
2 days ago
But the statement says 'maximum salary', so it should be B and F.
upvoted 0 times
...
Alyssa
5 days ago
I disagree, I believe the correct answers are A and C.
upvoted 0 times
...
Lisbeth
16 days ago
This question is like a bad joke, isn't it? 'The names of employees maximum salary will appear fist to descending order' - seriously, who writes this stuff?
upvoted 0 times
Colene
23 hours ago
A) All remaining employee names will appear in an ascending order
upvoted 0 times
...
...
Keneth
17 days ago
I'm going to have to go with B and F on this one. The question is clear - it's asking for the true statements, and those two options just make the most sense to me.
upvoted 0 times
...
Tess
22 days ago
I think the correct answers are B and F.
upvoted 0 times
...
Nan
22 days ago
D and E? Really? That's just plain wrong. This exam is testing our knowledge, not our ability to pick the most ridiculous answers.
upvoted 0 times
Dewitt
4 days ago
I agree, D and E are definitely not true.
upvoted 0 times
...
Raul
6 days ago
I think the correct answers are A and C.
upvoted 0 times
...
...
Lennie
24 days ago
A and C seem like the obvious choices here. I'm not sure why they're throwing in all these other options - it's almost like they're trying to confuse us!
upvoted 0 times
...
Ilda
25 days ago
Hmm, this one's tricky. I'm going to go with B and F. Gotta keep those high-earners happy, right?
upvoted 0 times
Fletcher
2 days ago
Yeah, that makes sense. High-earners first in ascending order.
upvoted 0 times
...
Sue
8 days ago
I agree with you on that. And I think F is also true because it follows the same logic.
upvoted 0 times
...
Vilma
9 days ago
I think B is correct because it makes sense to prioritize employees with the maximum salary.
upvoted 0 times
...
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77