Skip to content

Commit 0a34f9e

Browse files
committed
Placements
Placements
1 parent 9d56fca commit 0a34f9e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Medium/Placements.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SELECT NAME FROM(
2+
SELECT S.Id SID, S.NAME, f.friend_id FID, p1.Salary S1, p2.Salary S2
3+
FROM Students S
4+
INNER JOIN friends f ON (S.Id = f.id )
5+
inner join packages p1 ON(S.Id = p1.Id)
6+
inner join packages p2 ON(f.friend_id = p2.Id)
7+
8+
) A WHERE S2>S1
9+
ORDER BY S2;

0 commit comments

Comments
 (0)