We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
So we need to compare the the salary of Friends and Best Friends.
Questions:
1. How to write a query to compare Salary?
Solution: using self join on table that has Salary which is Packages
2. We need to compare Salary based on ID and Friend_ID, how to do this?
Solution: we want to compare Salary therefore Salary is the main query.
Steps
1. Let's do a SELF JOIN to get Salary of students and best friends
Placements
You are viewing a single comment's thread. Return to all comments →
Extract the information
So we need to compare the the salary of Friends and Best Friends. Questions: 1. How to write a query to compare Salary? Solution: using self join on table that has Salary which is Packages 2. We need to compare Salary based on ID and Friend_ID, how to do this? Solution: we want to compare Salary therefore Salary is the main query.
Steps 1. Let's do a SELF JOIN to get Salary of students and best friends
Below is the completed query.