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
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
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
Math,
1 month ago
Social Sciences,
1 month ago
India Languages,
3 months ago
Math,
3 months ago
English,
10 months ago