We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
with friend_sal as (
select f.id,f.friend_id,p.salary from friends f join packages p
on f.friend_id = p.id
),stud_sal as (
select s.id,s.name,p1.salary from students s join packages p1
on s.id = p1.id
)
select ss.name from stud_sal ss join friend_sal fs
ON ss.id = fs.id where fs.salary > ss.salary order by fs.salary
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Placements
You are viewing a single comment's thread. Return to all comments →
with friend_sal as ( select f.id,f.friend_id,p.salary from friends f join packages p on f.friend_id = p.id
),stud_sal as ( select s.id,s.name,p1.salary from students s join packages p1
on s.id = p1.id ) select ss.name from stud_sal ss join friend_sal fs ON ss.id = fs.id where fs.salary > ss.salary order by fs.salary