Deal of The Day! 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
4 months ago
But the statement says 'maximum salary', so it should be B and F.
upvoted 0 times
...
Alyssa
4 months ago
I disagree, I believe the correct answers are A and C.
upvoted 0 times
...
Lisbeth
5 months 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
Quentin
3 months ago
C) All remaining employee names will appear in ascending order
upvoted 0 times
...
Miles
4 months ago
B) The names of employees remaining the maximum salary will appear first in an ascending order
upvoted 0 times
...
Colene
4 months ago
A) All remaining employee names will appear in an ascending order
upvoted 0 times
...
...
Keneth
5 months 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
5 months ago
I think the correct answers are B and F.
upvoted 0 times
...
Nan
5 months 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
Aliza
4 months ago
Yeah, let's go with A and C for sure.
upvoted 0 times
...
Colton
4 months ago
So, A and C it is then.
upvoted 0 times
...
Dewitt
4 months ago
I agree, D and E are definitely not true.
upvoted 0 times
...
Raul
4 months ago
I think the correct answers are A and C.
upvoted 0 times
...
...
Lennie
5 months 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
5 months 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
Lina
4 months ago
Definitely. It's important to keep the top performers happy.
upvoted 0 times
...
Fletcher
4 months ago
Yeah, that makes sense. High-earners first in ascending order.
upvoted 0 times
...
Sue
4 months ago
I agree with you on that. And I think F is also true because it follows the same logic.
upvoted 0 times
...
Vilma
4 months ago
I think B is correct because it makes sense to prioritize employees with the maximum salary.
upvoted 0 times
...
...

Save Cancel