Question: Assuming no two students (i.e., ids) earn the same salary in incomes and each student (id) has only one friend (friend_id) in friends . Write

Assuming no two students (i.e., ids) earn the same salary in incomesAssuming no two students (i.e., ids) earn the same salary in incomes and each student (id) has only one friend (friend_id) in friends. Write an SQL statement to retrieve the names of the students who earn less than their friends. Output the student names in descending orders of their friends salaries.

Given tables students, friends, and incomes with the following schemas, students Column Type INTEGER name TEXT friends Column Type INTEGER friend_id INTEGER incomes Column Type INTEGER REAL salary Assuming no two students (i.e., id's) earn the same salary in incomes and each student (id) has only one friend (friend_id) in friends. Write an SQL statement to retrieve the names of the students who earn less than their friends. Output the student names in descending orders of their friends' salaries. Given tables students, friends, and incomes with the following schemas, students Column Type INTEGER name TEXT friends Column Type INTEGER friend_id INTEGER incomes Column Type INTEGER REAL salary Assuming no two students (i.e., id's) earn the same salary in incomes and each student (id) has only one friend (friend_id) in friends. Write an SQL statement to retrieve the names of the students who earn less than their friends. Output the student names in descending orders of their friends' salaries

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!