Computer Science, asked by ramalingeswararaovai, 3 months ago

Write a query to display Course ID and course name of the course
which has second maxmum fee. If there are more than two courses
then sort it by using Course ID​

Answers

Answered by anitakeshari349
4

Answer:

select

course_id,

course_name,

fees

from

( select

*,

dense_rank() over (order by fees) as rnk

from courses

) t

where rnk = 2

Answered by paranjapeabha17
6

Answer:

select courseid, coursename

from course

where fees = (select max(fees) from course where fees < ( select max (fees) from course ) )

order by courseid;

Explanation:

We select the second-highest fee from the subquery.

Similar questions