• + 0 comments

    SELECT std.Name as Friend

    FROM Students as std INNER JONI Friends as friend ON std.ID = friend.ID INNER JOIN Packages ON std.ID = Packages.ID INNER JOIN Packages as pck ON friend.Friend_ID = pck.ID WHERE pck.Salary > Packages.Salary ORDER BY pck.Salary ASC