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...
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 2 times
...
...
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 agosafasayed19
Most Recent 2 months, 3 weeks agoPsili
3 months, 1 week agoNennuzzo
1 year agoShrimathi
1 year, 5 months agoShrimathi
1 year, 5 months agoShrimathi
1 year, 5 months agoyanoolthecool
1 year, 5 months agosamuele1981
1 year, 5 months agoJuciDelevati
1 year, 7 months agoNelita
1 year, 7 months agoalic_alex
1 year, 10 months agocadcadley
1 year, 12 months agodexdinh91
2 years agodexdinh91
2 years agoRamona13
2 years, 2 months agoiuliana23
2 years, 2 months agokarols32
2 years, 2 months agoninjax_m
1 year, 11 months ago