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.
SELECT s.name
FROM students s,friends f,packages p1,packages p2
WHERE s.id = f.id and s.id = p1.id and f.friend_id = p2.id and p2.salary > p1.salary
ORDER BY p2.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 →
SELECT s.name FROM students s,friends f,packages p1,packages p2 WHERE s.id = f.id and s.id = p1.id and f.friend_id = p2.id and p2.salary > p1.salary ORDER BY p2.salary;