A. The names of employees earning the maximum salary will appear first in an unspecified order: Because if there more than one employ with the same salary the order is unspecified cuz both will use 'A' letter.
B. All remaining employee names will appear in descending order. Because there is last_name DESC
I should just google the answers instead of depending on the ones here...
I tested, D & F are right. Order by 'A' means nothing, are not sorted. all of salary > avg salary rows that are not sorted at first, then they are sorted by 'last_name DESC;' at the end of query.
see answer by ninjax_m further down:
D. All remaining employee names will appear in ascending order.
Ascending is default ordering. case - else outputs employee name that should be sorted ascending.
F. The names of employees earning the maximum salary will appear first in descending order.
They appear first because of 'A' , then after that they are sorted by name, but in descending order (2nd order by clause).
B. All remaining employee names will appear in descending order.
Correct: The last_name DESC clause ensures this.
F. The names of employees earning the maximum salary will appear first in descending order.
Correct: The last_name DESC clause ensures this.
Chat GPT says A, B
The two correct answers are:
A. The names of employees earning the maximum salary will appear first in an unspecified order.
In the CASE statement, when the employee's salary matches the maximum salary (MAX(salary)), the value 'A' is assigned. Since 'A' comes before any other string alphabetically, employees with the maximum salary will be listed first. However, the order of employees with the maximum salary is unspecified unless there is a secondary sort defined for this group (which is not in this query).
B. All remaining employee names will appear in descending order.
After the maximum salary employees are displayed, all other employees will be ordered by their last names in descending order due to the clause ORDER BY last_name DESC.
DF is the correct
create table emp(last_name varchar2(100), salary number);
insert all
into emp values('Shri',5000)
into emp values('van',5000)
into emp values('ben',15000)
into emp values('zoo',15000)
into emp values('cat',4000)
select * from dual;
output:
zoo
ben
Shri
cat
van
A. The names of employees earning the maximum salary will appear first in an unspecified order: Because if there more than one employ whit the same salary the order is unspecified.
B. All remaining employee names will appear in descending order. Because there is last_name DESC
I tested it and these answers are correct.
Employees which have not a highest salary appear in ascending order and it's true because ELSE starts working and it sorts by last_name ASC(as default for sorting without giving any postfix).
But the second answer, F one is interesting because where it appear, depends from a character after THEN. We have 'A' now and employees with highest salary comes first but when I replace it by 'B' employees appear from 5th row, by 'C' from 14th row.
It sorts by last_name DESC, take it from end of query'.
D. All remaining employee names will appear in ascending order.
Ascending is default ordering. case - else outputs employee name that should be sorted ascending.
F. The names of employees earning the maximum salary will appear first in descending order.
They appear first because of 'A' , then after that they are sorted by name, but in descending order (2nd order by clause).
upvoted 3 times
...
...
This section is not available anymore. Please use the main Exam Page.1z0-071 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
yanoolthecool
Highly Voted 1 year, 3 months agoEren1998
Most Recent 1 month, 2 weeks agoacting_dowry_chill
1 month, 3 weeks agoThameur01
2 months, 3 weeks agosafasayed19
6 months agoPsili
6 months, 2 weeks agoNennuzzo
1 year, 4 months agoShrimathi
1 year, 8 months agoShrimathi
1 year, 8 months agoShrimathi
1 year, 8 months agoyanoolthecool
1 year, 8 months agosamuele1981
1 year, 9 months agoJuciDelevati
1 year, 10 months agoNelita
1 year, 10 months agoalic_alex
2 years, 1 month agocadcadley
2 years, 3 months agodexdinh91
2 years, 3 months agodexdinh91
2 years, 3 months agoRamona13
2 years, 5 months agoiuliana23
2 years, 5 months agokarols32
2 years, 5 months agoninjax_m
2 years, 2 months ago