Question 8 (Placements)

 avatar
user_6227789376
mysql
3 years ago
268 B
2
Indexable
-- Medium
-- Question 8 (Placements):

Select stud.name FROM students stud 
JOIN friends Friend ON stud.id = Friend.id
JOIN packages temp1 ON stud.id = temp1.id
JOIN packages temp2 ON Friend.friend_id = temp2.id
WHERE temp2.salary > temp1.salary
ORDER BY temp2.salary;
Editor is loading...