Question 8 (Placements)

 avatar
user_6227789376
mysql
2 years ago
268 B
0
Indexable
Never
-- 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;