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 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
Get step-by-step solutions from verified subject matter experts
